rootfs/home/andre/home-sync.sh aktualisiert
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user