Files
bin/backup-success

30 lines
688 B
Bash
Executable File

#!/bin/bash
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"
exit -1
fi
# 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)"
let diff_in_days="(${now}-${lastUpdate})/(3600*24)"
if [ $diff_in_days -gt 7 ]; then
echo ": mara not backed up to borric"
exit -1
fi
ret=`/home/ddp/bin/restic-success`
if [ $? -ne 0 ]; then
echo ": restic backups failed"
exit -1
fi
exit 0