rootfs/home/andre/home-sync.sh aktualisiert

This commit is contained in:
2026-02-28 18:39:17 +01:00
parent 09d812bfd0
commit 20c8f06a76

View File

@@ -6,12 +6,16 @@ SRC="/home/${USR}/"
DEST="${USR}@${NAS}:/volume1/homes/${USR}/tux-home/"
RSYNC_OPTS="-az --delete --partial --timeout=20"
echo "Prüfe ob NAS erreichbar ist"
# Ping check (optional, verhindert lange Timeouts)
ping -c1 ${NAS} >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$(date): NAS unreachable"
echo "$(date): NAS nicht erreichbar"
exit 0
fi
echo "NAS erreichbar. Starte rsync"
# Sync starten
rsync $RSYNC_OPTS "$SRC" "$DEST"
rsync $RSYNC_OPTS "$SRC" "$DEST"
echo "Fertig"