Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

/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


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.