I take a backup of my root directory (/) during shutdown to the attached storage and then rsync back from the attached storage to / during booting.

what's the rsync command I need to use during shutdown? Please tell me the list of directories to exclude

whats the rsync command I need to use during booting ? If there are any new files on the destination I dont want to overwrite them, when I do a rsync from source to destination


I would create a file for my exclusions and use --exclude-from=/rsync_exclude.txt. See this post for the list of exclusions when backing up the root partition, as well as an example command.

That being said, I don't really understand what you are doing? Why would you sync the files from the external storage at every boot?

  • I think its better if you put all files that you want to backup in to folder(s) and backup only that folder. Anyway, thanks for link of list of exclusions - i can use it for myself that one... – coolwater Nov 22 '09 at 1:05

The rsync man-page has all the details.

I usually do something like:

rsync -avh --exclude /tmp/ --exclude /var/tmp/ --exclude /$any_other_directory/ / /$backup_location/

To sync it back one would use:

rsync -avuh /$backup_location/ /

where the additional -u is "--update skip files that are newer on the receiver"

Your Answer

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