tar backup ignore files

Gary Aitken ubuntu at dreamchaser.org
Sun Jun 28 04:32:23 UTC 2020


On 6/26/20 10:47 AM, Colin Watson wrote:
> On Wed, Jun 24, 2020 at 08:27:49PM -0600, Gary Aitken wrote:
>> I'm backing up a gcloud vm running ubuntu 16.04.01 using tar, and
>> am wondering which pieces can be safely ignored.  The system is
>> running redmine on apache. I'm currently ignoring the following:
>> 
>> /cache /dev/* /lost+found/* /media/* /proc/* /sys/* /tmp/* /mnt/* 
>> /var/cache/apt/* */cache/* [.]tmp$ [.]core$ [.]snap$ /[.]cache/* 
>> /var/lib/lxcfs
>> 
>> I'm wondering in particular if the /sys/* files and /var/lib/lxcfs
>> are really safe to ignore.  A du of /var/lib/lxcfs comes up zero,
>> but then no-one was doing much when I did that.  du of /sys also
>> comes up zero.  Are these all just lock files?
> 
> I'd suggest using --one-file-system rather than most of these, and
> then backing up each file system that you actually want to back up 
> separately.

Thanks, I was wondering about that...
This system has only one file system listed in /etc/fstab, but it's unclear to
me if that constitutes "one file system" when there are entries in /var/lib/lxcfs.

>> /var/cache is not empty, but I'm assuming since it's a "cache"
>> directory it need not be backed up.  True?
> 
> In theory, though you would run into some bugs in practice, e.g. 
> https://bugs.debian.org/681893.

ugh, thanks for the heads-up

On 6/26/20 12:12 PM, Sheemon Lists wrote:
> I would backup lost+found;  If it is empty, it costs nothing.  If it
> is not empty, it may be some forgotten file that was lost in a crash
> sometime ago.  Having it saved my hide more than once.

Thanks

> /dev:  I did
> have an opportunity to count my blessings for backing up /dev.  Yes,
> there is little there [aside from mirror backup of filesystems -
> another subject], but if a crash is bad enough, /dev will contain the
> actual map of your devices at the time of the crash. MAKEDEV, which
> used to be the first object "put" in /dev contains what some
> programmers meant to be in /dev, not what should be there, definitely
> not what was there. But I am just an old paranoid, who knows very
> little.

Can I ask how you restored that system if /dev was hosed?  Were there
just things missing that are not "core" devs, so restoring them was only
needed for some apps to work?

Gary





More information about the ubuntu-users mailing list