Fix #1675. Add check to ensure files are up-to-date in /home/backup/.

This commit is contained in:
Romain Dessort 2016-05-10 18:14:21 -04:00
parent 83c0371334
commit 452b8eea32

View file

@ -67,6 +67,7 @@ IS_SAMBAPINPRIORITY=1
IS_KERNELUPTODATE=1
IS_UPTIME=1
IS_MUNINRUNNING=1
IS_BACKUPUPTODATE=1
#Proper to OpenBSD
IS_SOFTDEP=1
@ -409,6 +410,16 @@ if [ -e /etc/debian_version ]; then
[ $(stat -c "%Y" /var/lib/munin/*/*uptime-g.rrd |head -1) -lt $(date +"%s" -d "now - 10 minutes") ] && echo 'IS_MUNINRUNNING FAILED!'
[ $(stat -c "%Y" /var/cache/munin/www/*/*/uptime-day.png |head -1) -lt $(date +"%s" -d "now - 10 minutes") ] && echo 'IS_MUNINRUNNING FAILED!'
fi
# Check if files in /home/backup/ are up-to-date
if [ "$IS_BACKUPUPTODATE" = 1 ]; then
[ -d /home/backup/ ] && for file in /home/backup/*; do
if [ $(stat -c "%Y" $file) -lt $(date +"%s" -d "now - 1 day") ]; then
echo 'IS_BACKUPUPTODATE FAILED!'
break;
fi
done
fi
fi