Add backups for mariadb nightly like we do for postgres.

This allows us to back up /backups and get a good few days database
dumps on mariadb servers.
This commit is contained in:
Kevin Fenzi 2015-06-04 17:29:16 +00:00
parent 9d31407e01
commit ef817b7d0c
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,10 @@
#!/bin/bash
# Backup a database *locally* to /backups/.
DB=$1
# Make our latest backup
/bin/mysqldump --add-drop-database $DB | /usr/bin/xz > /backups/$DB-$(date +%F).dump.xz
# Also, delete the backup from a few days ago.
rm -f /backups/$DB-$(date --date="3 days ago" +%F).dump.xz