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.
26 lines
557 B
26 lines
557 B
#!/bin/bash -e
|
|
|
|
if [ $# -lt 3 ]; then
|
|
echo 'Usage: sync local_dir rsync_host rsync_dir ssh_user ssh_keyfile'
|
|
exit 1
|
|
fi
|
|
|
|
umask 002
|
|
|
|
TO=/mirror/root/$1
|
|
RSYNC_HOST=$2
|
|
RSYNC_DIR=$3
|
|
SSH_USER=$4
|
|
SSH_KEYFILE=$5
|
|
RSYNC_HOST=$SSH_USER@$RSYNC_HOST
|
|
|
|
ADDRESS=$(cat ~/config/ADDRESS)
|
|
|
|
exec nice rsync -aH --no-owner --no-group --delete \
|
|
--timeout=3600 -4 \
|
|
--exclude .~tmp~/ \
|
|
--quiet --stats --log-file=/home/mirror/merlin/logs/transfer-ssh.log \
|
|
-e "ssh -b $ADDRESS -i $SSH_KEYFILE" \
|
|
$RSYNC_HOST:$RSYNC_DIR/ $TO
|
|
|
|
#134.71 needs to be used
|
|
|