#!/bin/sh

set -x
~nico/bin/backup-marker

dsthost="$1"; shift
case "$dsthost" in
    loch|rloch)
        dst=root@$dsthost:/home/services/backup/notebook-manuell/home/users/nico/
    ;;
    nico-vm)
        dst=nico-vm.schottelius.org:/data
    ;;
    freiheit)
        dst=freiheit:
    ;;
    local)
	    dst=root@192.168.0.20:/home/services/backup/notebook-manuell/home/users/nico/
    ;;
    nico-data)
	    dst=nico-data.schottelius.org:/home/nico
    ;;
    *)
        echo "Unknown $1" >&2
        exit 1
    ;;
esac

start=$(date)
rsync -avS --delete --progress 	\
	--exclude-from=/home/users/nico/.ccollect/defaults/exclude \
    --exclude /.cache \
    --exclude ~/temp/ \
	"$@" 			\
	~/ "$dst"
end=$(date)

echo $start
echo $end