5

I have written a rsync-based system backup for my Linux system. The aim is to be able to redeploy the system entirely from the saves, so I don't only backup homedirs. I have excluded a few top-level directories from the backup: /proc, /sys, /mnt, /tmp.

I wonder whether I can exclude /run and still be able to get a viable save? I observe that it takes a lot of disk space on my backup disk (mostly with /run/shm).

1 Answer 1

9

/run is transient data, it's often on tmpfs to guarantee it's discarded when you shutdown. No point backing it up.

I would use the -x, --one-file-system option of rsync and backup only the filesystems you want to backup. That would automatically exclude the /proc, /sys, etc. and /run if it's on tmpfs, and would safeguard against users mounting fuse or remote file systems.

Something like:

rsync -x --relative --other-options / /boot destination/

Or even better, use LVM or any snapshotting file system like btrfs, zfs, nilfs... and take a snapshot before running rsync on the snapshot mounted read-only. That means you've got a better chance to have consistent data on the backup (and avoid rsync triggering automounts or updating access times for instance).

1
  • I'm not sure about the -x rsync option in my case. It would exclude /run, but apparently not /proc and /sys. Also, it would exclude (in my case, again) /boot, which I need. However, I will definitely look further into LVM snapshots. I already use LVM (which is not a FS...) on this machine but have never used this feature. Thanks.
    – Eusebius
    Jan 31, 2013 at 15:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .