mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-26 13:18:35 -06:00
chg: Exit if remote machine is not available
This commit is contained in:
parent
8563d1c423
commit
31210178f8
1 changed files with 5 additions and 0 deletions
|
@ -73,6 +73,11 @@ HMDIR="/mnt/storage/sintan"
|
||||||
BKDIR="server-rsync:/mnt/storage"
|
BKDIR="server-rsync:/mnt/storage"
|
||||||
LGDIR="/home/sintan"
|
LGDIR="/home/sintan"
|
||||||
|
|
||||||
|
if ! $(ping server-ts -nqc 1 -W 1 >/dev/null 2>&1); then
|
||||||
|
echo "Remote machine not available. Exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo $(date) "| Pulling pkglists_server to HDD..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
|
echo $(date) "| Pulling pkglists_server to HDD..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
|
||||||
rsync -aAXH --delete --stats "$BKDIR/Documents/Backup/pkglists_server/" "$HMDIR/Documents/Backup/pkglists_server/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
|
rsync -aAXH --delete --stats "$BKDIR/Documents/Backup/pkglists_server/" "$HMDIR/Documents/Backup/pkglists_server/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
|
||||||
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
|
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
|
||||||
|
|
Loading…
Reference in a new issue