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