(linux_command_line)-> (Parent)->remote sync (rsync) with marked backup files
submited by Russell Sat 07 Jul 07|
I use this simple 3 line script to do remote backups.
This script takes the date to create a suffix. If a file already exists on the remote server, it is renamed.
setenv DATENAME `date +%m%d%y`
rsync -avb --partial --suffix=~$DATENAME path_to_backup user@host:path_to_storefiles
If you want to use a different format for the date, or make backups more than once per day, change the date parameter (do a man date for options)
for backups done on June 5th 2007.
NOTE: DO NOT INCLUDE THE TRAILING SLASH in the path_to_backup unless you WANT each file or folder to be copied as a file or folder into path_to_storefiles if you want to backup the path as a single folder, leave the tailing slash off.
Using the parameters above, rsync copies only the changed files and will even attempt to efficiently copy a file, so if only a small part of a file has changed, (say a log file that is being appended to ) it only needs to transfer the data that is new. This means that the network load of using this method of backup is very low ( after the initial full copy it does the first time)
I have another script that I use to "cleanup" old unneeded files off the backup server, but I need to edit it so that it is generic. I will post it when I have done this.
Add comment or question...: