I want rsync the / folder with a btrfs snapshot. How to avoid a potential crash? Should I exclude some folders such as /proc?


If you are looking for a simple rsync command to backup your full filesystem, consider using these options:

# -a --archive
# -v --verbose
# -A --acls
# -X --xattrs
# -x --one-file-system
# --numeric-ids

The -aAX options preserve permissions, mode, owner, group, mtime, ACLs and xattrs. The -v option prints all files being transferred. The --numeric-ids option may be relevant if you sync to a remote location rather than a local disk.

To answer your initial question, you are likely interested in the -x option (--one-file-system). This prevents rsync from descending in other mount points such as /proc and /sys. Note however, that it will also avoid copying /home if that is on a different mount point. In that case you need to run another rsync command for /home/.

  • thanks, this is exactly what I needed! sorry for the long wait. – Dan Jan 11 '15 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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