nsbin/sync-to
2020-02-26 15:23:15 +01:00

31 lines
506 B
Bash
Executable file

#!/bin/sh
set -x
~nico/bin/backup-marker
dsthost="$1"; shift
case "$dsthost" in
loch|rloch)
dst=root@loch.place7.ungleich.ch:/raid/incoming/$(hostname)
;;
nico-vm)
dst=nico-vm.schottelius.org:/data
;;
*)
echo "Unknown $1" >&2
exit 1
;;
esac
start=$(date)
rsync -avS --delete --progress \
--exclude /.cache \
--exclude /.cdist/cache \
--exclude ~/temp/ \
--exclude ~/.mu/ \
"$@" \
~/ "$dst"
end=$(date)
echo $start
echo $end