nsbin/sync-to
Nico Schottelius 899979d3ba handle sparse files correctly
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-12-21 09:25:53 +01:00

36 lines
675 B
Bash
Executable file

#!/bin/sh
set -x
~nico/bin/backup-marker
dsthost="$1"; shift
case "$dsthost" in
42)
dst=42:/home/services/backup/bento
;;
loch)
dst=root@loch:/home/services/backup/bento-manuell
;;
zuhause)
dst=root@zuhause.schottelius.org:/home/services/backup/bento-manuell
;;
*)
echo "Unknown $1" >&2
exit 1
;;
esac
start=$(date)
rsync -avS --delete --progress \
--exclude '/proc/*' \
--exclude '/tmp/*' \
--exclude '/sys/*' \
--exclude '/dev/*' \
--exclude '/home/users/nico/.bitcoin/blocks/' \
--exclude '/home/users/nico/.bitcoin/chainstate/' \
"$@" \
/ "$dst"
end=$(date)
echo $start
echo $end