You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
504 B
25 lines
504 B
#!/bin/bash -e
|
|
|
|
if [ $# -lt 3 ]; then
|
|
echo 'Usage: sync local_dir rsync_host rsync_dir'
|
|
exit 1
|
|
fi
|
|
|
|
umask 002
|
|
|
|
TO=/mirror/root/$1
|
|
RSYNC_HOST=$2
|
|
RSYNC_DIR=$3
|
|
ADDRESS=$(cat ~/config/ADDRESS)
|
|
|
|
if test -n "$RSYNC_USER"; then
|
|
RSYNC_HOST=$RSYNC_USER@$RSYNC_HOST
|
|
fi
|
|
|
|
mkdir -p $TO
|
|
|
|
exec nice rsync -aH --no-owner --no-group --delete \
|
|
--timeout=3600 -4 --address=$ADDRESS \
|
|
--exclude ".*/" \
|
|
--quiet --stats --log-file=/home/mirror/merlin/logs/transfer.log \
|
|
$RSYNC_HOST::$RSYNC_DIR $TO
|
|
|