0

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

2 Answers2

2

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?

Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
  • 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 01:05
1

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"

ptman
  • 28,394
  • 2
  • 30
  • 45