Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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).

share|improve this question

1 Answer 1

/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).

share|improve this answer
    
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 '13 at 15:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.