Fixing backup scripts
This commit is contained in:
parent
da07159824
commit
0ed17e8215
1 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ echo "$drive2 / $mount2 / $mounted2"
|
|||
echo "$drive3 / $mount3 / $mounted3"
|
||||
|
||||
# If any drive isn't found, exit:
|
||||
if [[ $mounted1 != 0 ]] && [[ munted2 != 0 ]] && [[ $mounted3 != 0 ]] ; then
|
||||
if [[ $mounted1 != 0 ]] || [[ munted2 != 0 ]] || [[ $mounted3 != 0 ]] ; then
|
||||
payload="{\"message\": \"Backup stopped. One or more local drives are not mounted.\nDate: `date`\", \"priority\": 2,\"title\": \"backups-rpi4: Backup Stopped\"}"
|
||||
curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload"
|
||||
|
||||
|
@ -37,7 +37,7 @@ echo "Drive 2: $drive2"
|
|||
echo "Drive 3: $drive3"
|
||||
|
||||
echo "Checking if the NAS is mounted on nuc-docker01:"
|
||||
check=$(ssh root@nuc-docker01 df -h | grep 192.168.1.100)
|
||||
check=$(ssh root@nuc-docker01 df -h | grep 192.168.1.100 | wc -l)
|
||||
if [[ $check != 1 ]] ; then
|
||||
payload="{\"message\": \"Backup stopped. Synology isn't mounted\nDate: `date`\", \"priority\": 2,\"title\": \"backups-rpi4: Backup Stopped\"}"
|
||||
curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload"
|
||||
|
@ -156,7 +156,7 @@ echo "$drive2 / $mount2 / $mounted2"
|
|||
echo "$drive3 / $mount3 / $mounted3"
|
||||
|
||||
# If any drive isn't found, exit:
|
||||
if [[ $mounted1 != 0 ]] && [[ munted2 != 0 ]] && [[ $mounted3 != 0 ]] ; then
|
||||
if [[ $mounted1 != 0 ]] || [[ munted2 != 0 ]] || [[ $mounted3 != 0 ]] ; then
|
||||
payload="{\"message\": \"Data Vol Backup stopped. One or more local drives are not mounted.\nDate: `date`\", \"priority\": 2,\"title\": \"backups-rpi4: Data Vol Backup Stopped\"}"
|
||||
curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload"
|
||||
|
||||
|
@ -167,7 +167,7 @@ echo "Drive 2: $drive2"
|
|||
echo "Drive 3: $drive3"
|
||||
|
||||
echo "Checking if the NAS is mounted on nuc-docker01:"
|
||||
check=$(ssh root@nuc-docker01 df -h | grep 192.168.1.100)
|
||||
check=$(ssh root@nuc-docker01 df -h | grep 192.168.1.100 | wc -l)
|
||||
if [[ $check != 1 ]] ; then
|
||||
payload="{\"message\": \"Data Vol Backup stopped. Synology isn't mounted\nDate: `date`\", \"priority\": 2,\"title\": \"backups-rpi4: Data Vol Backup Stopped\"}"
|
||||
curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload"
|
||||
|
|
Loading…
Reference in a new issue