mirror/csc-sync-standard

22 lines
464 B
Plaintext
Raw Normal View History

2010-03-07 12:21:40 -05:00
#!/bin/bash -e
2007-11-07 20:06:11 -05:00
if [ $# -lt 3 ]; then
2007-11-07 20:06:11 -05:00
echo 'Usage: sync local_dir rsync_host rsync_dir'
exit 1
fi
2010-03-07 12:21:40 -05:00
umask 002
2007-11-07 20:06:11 -05:00
2010-03-07 12:21:40 -05:00
TO=/mirror/root/$1
2007-11-07 20:06:11 -05:00
RSYNC_HOST=$2
RSYNC_DIR=$3
2010-03-07 12:21:40 -05:00
if test -n "$RSYNC_USER"; then
RSYNC_HOST=$RSYNC_USER@$RSYNC_HOST
2007-11-07 20:06:11 -05:00
fi
2010-03-07 12:21:40 -05:00
exec nice rsync -aH --no-owner --no-group --delete \
--timeout=3600 -4 --address=129.97.134.71 \
--exclude .~tmp~/ \
--quiet --stats --log-file=/home/mirror/merlin/logs/transfer.log \
$RSYNC_HOST::$RSYNC_DIR $TO