:: Re: [DNG] What not to back up
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Olaf Meeuwissen
Datum:  
To: Hendrik Boom
CC: dng
Betreff: Re: [DNG] What not to back up
Hi Hendrik,

Hendrik Boom writes:

> I'm setting up a new backup script that will do it all piecemeal so
> that if a part of it fails, it can be retried without having to start
> *everythng* over from scratch.
>
> Which top-level filesystems should *not* be backed up.
>
> To start with, I presumably shouldn't back up
>
> /proc
> /tmp
> /dev (cause I'm using some version of *udev)
> /mnt


ACK.

> and I certainly should back up /var, /usr. /root, /bin,
> /boot, /etc, /home, /lib, /lib64, /sbin


I wouldn't bother with /var/cache and /var/log but you're talking
top-level ;-)

/boot is managed by installing kernel images and grub (using settings in
/etc/grub) so isn't all that important to include. At least on amd64.

> But what about
>
> /run
> /srv
> /sys
> ?


Both /run and /sys are tmpfs file systems. Not worth backing up.

Basically, you should only care about a subset of what lives below the
mount points listed by

df | grep ^/ | awk '{print $6}'

and make sure your backup command doesn't cross file system boundaries.
That should automatically exclude things like /dev, /proc, /run, /sys
and may (or may not) exclude /tmp (depending on installation choices).
As /mnt is meant for temporary mounts, that should be excluded too.

> What are those even used for?


I would have pointed you to the FHS but as Lars pointed out already `man
7 hier` will tell.

Of course, if you don't use things like /srv and /opt, there's not much
of a cost to backing up the empty directories :-)

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join