diff --git a/rootfs/home/andre/home-sync.sh b/rootfs/home/andre/home-sync.sh new file mode 100644 index 0000000..4ae2db5 --- /dev/null +++ b/rootfs/home/andre/home-sync.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +USR=andre +NAS=192.168.100.250 +SRC="/home/${USR}/" +DEST="${USR}@${NAS}:/volume1/homes/${USR}/tux-home/" +RSYNC_OPTS="-az --delete --partial --timeout=20" + +# Ping check (optional, verhindert lange Timeouts) +ping -c1 ${NAS} >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "$(date): NAS unreachable" + exit 0 +fi + +# Sync starten +rsync $RSYNC_OPTS "$SRC" "$DEST" \ No newline at end of file