: !/bin/sh # get changes from remote machine if [ -z "$rdfull" ]; then rdfull="$1" fi if [ -z "$rmach" ]; then rmach="$2" fi if [ -z "$rdfull" ]; then echo "usage: dorsync remote_full_dirpath [remote_machibe]" exit 1 fi if [ -z "$rmach" ]; then rmach="telmax21" fi delopt="--delete" #delopt="" if [ "$rdfull" = "/tmp" ]; then delopt="" fi based=`dirname "$rdfull"` rdrel=`basename "$rdfull"` # -c, --checksum always checksum # -a, --archive archive mode, equivalent to -rlptgoD # -r, --recursive recurse into directories # -l, --links copy symlinks as symlinks # -H, --hard-links preserve hard links # -p, --perms preserve permissions # -o, --owner preserve owner (root only) # -g, --group preserve group # -D, --devices preserve devices (root only) # -t, --times preserve times # -x, --one-file-system don't cross filesystem boundaries # -z, --compress compress file data ( echo "dorsync [$rdrel] from $rmach in [$based]" #time 2>&1 rsync 2>&1 -vrlHpogDtxz $delopt "root@${rmach}:${rdfull}" "${based}" time 2>&1 rsync 2>&1 -vrlHpogDtx $delopt "root@${rmach}:${rdfull}" "${based}" echo "----------------------------------------------------------------------" echo "" ) | tee rsync.${rdrel}.log