Add MONGO_BACKUP check

This commit is contained in:
Benoît.S 2017-12-06 10:42:16 +01:00
parent 227249f411
commit 35f0cc3c86

View file

@ -92,6 +92,7 @@ IS_SQUIDLOGROTATE=1
IS_SQUIDEVOLINUXCONF=1
IS_SQL_BACKUP=1
IS_POSTGRES_BACKUP=1
IS_MONGO_BACKUP=1
#Proper to OpenBSD
IS_SOFTDEP=1
@ -600,6 +601,25 @@ if [ -e /etc/debian_version ]; then
fi
fi
if [ "$IS_MONGO_BACKUP" = 1 ]; then
if is_installed "mongodb-org-server"; then
# You could change the default path in /etc/evocheck.cf
MONGO_BACKUP_PATH=${MONGO_BACKUP_PATH:-"/home/backup/mongodump"}
if [ -d "$MONGO_BACKUP_PATH" ]; then
for file in ${MONGO_BACKUP_PATH}/*/*.{json,bson}; do
# Skip indexes file.
if ! [[ "$file" =~ indexes ]]; then
if [ -f $file ] && [ $(stat -c "%Y" $file) -lt $(date +"%s" -d "now - 2 day") ]; then
echo 'IS_MONGO_BACKUP FAILED!'
fi
fi
done
else
echo 'IS_MONGO_BACKUP FAILED!'
fi
fi
fi
if [ "$IS_LDAP_BACKUP" = 1 ]; then
if is_installed slapd; then
# You could change the default path in /etc/evocheck.cf