First commit

This commit is contained in:
2020-09-05 17:02:29 +03:00
commit eaa50da074
3 changed files with 45 additions and 0 deletions

18
Vol-Sync Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
#Script to sync the Red-Vol when it comes up with the Tui64 share.
INIT_DIR='/Red-Vol'
FINAL_DIR='/rksmb/*'
HOST_IP='192.168.1.66'
#Ping check
ping -c 4 $HOST_IP > /dev/null
#If there is ping, sync the Media and Backups subvolumes.
if [[ $(echo $?) == 0 ]]; then
sshpass -f /shmick/.ssh/sshpasskey rsync -aHAXv --progress --exclude="Torrents" shmick@$HOST_IP:$FINAL_DIR $INIT_DIR
#No DNS resolution
elif [[ $(echo $?) == 2 ]]; then
echo "Could not resolve host."
#No ping
elif [[ $(echo $?) == 1 ]]; then
echo "No communications with host."
fi