2013-09-17 11:12:59 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# standard vars stolen from cconf
|
|
|
|
__pwd="$(pwd -P)"
|
|
|
|
__mydir="${0%/*}"; __abs_mydir="$(cd "$__mydir" && pwd -P)"
|
|
|
|
__myname=${0##*/}; __abs_myname="$__abs_mydir/$__myname"
|
|
|
|
|
2013-12-12 07:39:37 +00:00
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "$0: src dst"
|
2013-09-17 11:12:59 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-12-12 07:39:37 +00:00
|
|
|
from=$1; shift
|
2013-09-17 11:12:59 +00:00
|
|
|
dst=$1; shift
|
|
|
|
|
2013-12-12 07:39:37 +00:00
|
|
|
case $from in
|
|
|
|
loch)
|
|
|
|
src=root@loch:/home/services/backup/bento-manuell/
|
|
|
|
;;
|
|
|
|
42)
|
|
|
|
src=root@42:/home/services/backup/bento/
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2013-09-17 11:12:59 +00:00
|
|
|
sshdir=$(cd "$__abs_mydir/../.ssh" && pwd -P)
|
|
|
|
sshkey=$sshdir/id_rsa
|
2013-12-12 07:39:37 +00:00
|
|
|
sshconfig=$sshdir/config
|
2013-09-17 11:12:59 +00:00
|
|
|
|
2013-10-26 21:28:38 +00:00
|
|
|
d1=$(date)
|
2013-09-17 11:12:59 +00:00
|
|
|
set -x
|
2013-12-21 08:25:53 +00:00
|
|
|
rsync -avS -e "ssh -i $sshkey -F $sshconfig" --delete "$src" "$dst"
|
2013-10-26 21:28:38 +00:00
|
|
|
echo $d1
|
|
|
|
date
|