tweak to allow for 7 day lag with mara to borric backup

This commit is contained in:
2025-08-16 11:11:36 +10:00
parent 09384aa5e9
commit a8945a467d

View File

@@ -1,12 +1,5 @@
#!/bin/bash #!/bin/bash
# check for Presence videos being sync'd // convert to eufy when I get time
#cnt=`sudo find /export/backup/Presence/ -name '*.mp4' -mtime -2 | wc -l`
#if [ $cnt = 0 ]; then
# echo "No Presence videos in the last 24 hours have been synced"
# exit -1
#fi
now="$(date +%s)" now="$(date +%s)"
# see if backup was 1 day or more ago (just in case we rsync broken data) # see if backup was 1 day or more ago (just in case we rsync broken data)
@@ -14,30 +7,22 @@ lastUpdate="$(stat -c %Y /home/ddp/tmp/bw-bkup.log)"
let diff_in_days="(${now}-${lastUpdate})/(3600*24)" let diff_in_days="(${now}-${lastUpdate})/(3600*24)"
if [ $diff_in_days -gt 1 ]; then if [ $diff_in_days -gt 1 ]; then
echo "bitwarden not backed up to DU in last 24 hours!" echo ": bitwarden not backed up to DU"
exit -1 exit -1
fi fi
# see if backup was 1 day or more ago (just in case we rsync broken data) # see if backup was 7 days or more ago (just in case we rsync broken data)
lastUpdate="$(stat -c %Y /home/ddp/tmp/last_mara_bkup)" lastUpdate="$(stat -c %Y /home/ddp/tmp/last_mara_bkup)"
let diff_in_days="(${now}-${lastUpdate})/(3600*24)" let diff_in_days="(${now}-${lastUpdate})/(3600*24)"
if [ $diff_in_days -gt 3 ]; then if [ $diff_in_days -gt 7 ]; then
echo "mara not backed up to borric in last 3 days!" echo ": mara not backed up to borric"
exit -1
fi
# check to see if docker tried to update images last night
lastUpdate="$(stat -c %Y /srv/docker/log/update-docker.log)"
let diff_in_days="(${now}-${lastUpdate})/(3600*24)"
if [ $diff_in_days -gt 1 ]; then
echo "watchtower did not run in last 24 hours!"
exit -1 exit -1
fi fi
ret=`/home/ddp/bin/restic-success` ret=`/home/ddp/bin/restic-success`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "restic backups failed?" echo ": restic backups failed"
exit -1 exit -1
fi fi