initial commit of bin scripts into git

This commit is contained in:
2023-11-08 13:38:19 +11:00
commit 3735eea3c6
113 changed files with 11631 additions and 0 deletions

44
backup-success Executable file
View File

@@ -0,0 +1,44 @@
#!/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)"
# see if backup was 1 day or more ago (just in case we rsync broken data)
lastUpdate="$(stat -c %Y /home/ddp/tmp/bw-bkup.log)"
let diff_in_days="(${now}-${lastUpdate})/(3600*24)"
if [ $diff_in_days -gt 1 ]; then
echo "bitwarden not backed up to DU in last 24 hours!"
exit -1
fi
# see if backup was 1 day or more ago (just in case we rsync broken data)
lastUpdate="$(stat -c %Y /home/ddp/tmp/last_mara_bkup)"
let diff_in_days="(${now}-${lastUpdate})/(3600*24)"
if [ $diff_in_days -gt 3 ]; then
echo "mara not backed up to borric in last 3 days!"
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
fi
ret=`/home/ddp/bin/restic-success`
if [ $? -ne 0 ]; then
echo "restic backups failed?"
exit -1
fi
exit 0