wildcard pattern per line of files to exclude EXCLUDES=$HOME/cron/excludes # the name of the backup machine BSERVER=owl # your password on the backup server export RSYNC_PASSWORD=XXXXXX ######################################################################## BACKUPDIR=`date +%A` OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES --delete --backup --backup-dir=/$BACKUPDIR -a" export PATH=$PATH:/bin:/usr/bin:/usr/local/bin # the following line clears the last weeks incremental directory [ -d $HOME/emptydir ] || mkdir $HOME/emptydir rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/ rmdir $HOME/emptydir # now the actual transfer rsync $OPTS $BDIR $BSERVER::$USER/current 2¡¢±¸·ÝÖÁÒ»¸ö¿ÕÏеÄÓ²ÅÌ #!/bin/sh export PATH=/usr/local/bin:/usr/bin:/bin LIST="rootfs usr data data2" for d in $LIST; do mount /backup/$d rsync -ax --exclude fstab --delete /$d/ /backup/$d/ umount /backup/$d done DAY=`date "+%A"` rsync -a --delete /usr/local/apache /data2/backups/$DAY rsync -a --delete /data/solid /data2/backups/$DAY 3¡¢¶Ôvger.rutgers.eduµÄcvsÊ÷½øÐоµÏñ #!/bin/bash cd /var/www/cvs/vger/ PATH=/usr/local/bin:/usr/freeware/bin:/usr/bin:/bin RUN=`lps x | grep rsync | grep -v grep | wc -l` if [ "$RUN" -gt 0 ]; then echo already running exit 1 fi rsync -az vger.rutgers.edu::cvs/CVSROOT/ChangeLog $HOME/ChangeLog sum1=`sum $HOME/ChangeLog` sum2=`sum /var/www/cvs/vger/CVSROOT/ChangeLog` if [ "$sum1" = "$sum2" ]; then echo nothing to do exit 0 fi rsync -az --delete --force vger.rutgers.edu::cvs/ /var/www/cvs/vger/ exit 0 4¡¢ÀûÓÃfindµÄÒ»ÖÖÇÉÃʽ rsync -avR remote:'`find /home -name "*.[ch]"`' /tmp/ ¿ÉÒÔÓÃÕâÖÖ·½·¨ÁгöÐèÒª±¸·ÝµÄÎļþÁÐ±í¡ª¡ªÕâÖÖ·½·¨Ëƺõ±È½ÏÉÙÈËÓõ½¡£ Îå¡¢²Î¿¼×ÊÁÏ£º 1¡¢ http://rsync.samba.org/ 2¡¢rsync examples 3¡¢rsync FAQ