#! /bin/sh ARCHIVE=`pwd`/$BASE/archives/`date +'%F-%H:%M'` CURRENT=`pwd`/$BASE/current RSHCMD= if [ "x$PROTO" == "xssh" ]; then RSHCMD="--rsh=ssh" elif [ "x$PROTO" == "xlocal" ]; then RSHCMD="" else echo "PROTO variable must either be local or ssh" exit -1 fi SKIP= if [ -e .skip-$BASE ]; then SKIP="--exclude-from=.skip-$BASE" echo "Using $SKIP" fi mkdir -p $ARCHIVE mkdir -p $CURRENT # --backup make backups # --backup-dir make backups into this directory # --one-file-system donīt cross filesystem boundaries # --delete delete files that donīt exist on the sending side # --archive archive mode # -ignore-errors delete even if there are IO errors # --exclude-from=FILE exclude patterns listed in FILE # --rsh=COMMAND specify the remote shell to use rsync --backup --one-file-system --delete --backup-dir=$ARCHIVE \ --archive --ignore-errors $SKIP $RSHCMD $REMOTE $CURRENT