nsbin/sync-to
2023-10-27 19:03:46 +02:00

32 lines
523 B
Bash
Executable file

#!/bin/sh
set -x
~nico/bin/backup-marker
dsthost="$1"; shift
case "$dsthost" in
loch|rloch)
dst=root@loch.ge.nau.so:/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/ \
--exclude /Downloads/ \
"$@" \
~/ "$dst"
end=$(date)
echo $start
echo $end