Backup script (rsync via ssh)

This is my totally not original backup script. I have symbolic links sitting in a directory, to files and folders I want to save. This directory is saved on a remote host.



set -u
set -e

# The directory to be backed up

# The remote host

# The directory on the remote host

# rsync options reminder:
#   -a archive mode
#   -v verbose
#   -z compression during transfer
#   --delete remove files that were deleted in the source directory
#   --copy-unsafe-links
#        when a symlink is encountered, the referent is copied
#        instead, *only* if it is out of the saved tree

rsync -avz --delete --copy-unsafe-links -e ssh $DIR $RHOST:$RDIR

Posted by pierre on 25 July 2007 in bash

Leave a Reply