Setup mariadb backup to make a latest link, make nrpe on db03 check that for backup age.

This commit is contained in:
Kevin Fenzi 2015-06-08 21:14:36 +00:00
parent 401ab5f4f8
commit 7fe5b0100e
2 changed files with 4 additions and 1 deletions

View file

@ -6,5 +6,8 @@ DB=$1
# Make our latest backup
/bin/mysqldump --user=root --add-drop-database $DB | /usr/bin/xz > /backups/$DB-$(date +%F).dump.xz
# link to the latest backup
ln -sf /backups/$DB-$(date +%F).dump.xz /backups/$DB-latest.xz
# Also, delete the backup from a few days ago.
rm -f /backups/$DB-$(date --date="3 days ago" +%F).dump.xz