Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

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?

share|improve this answer
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"

share|improve this answer

Your Answer


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