tar backup ignore files
Colin Watson
cjwatson at ubuntu.com
Fri Jun 26 16:47:17 UTC 2020
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.
> /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.
--
Colin Watson (he/him) [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list