Import first work on the pagure role

This commit is contained in:
Pierre-Yves Chibon 2015-04-02 19:09:05 +02:00
parent 49a3736f4a
commit 2d45402570
8 changed files with 754 additions and 0 deletions

View file

@ -0,0 +1,10 @@
#!/bin/bash
# Backup a database *locally* to /backups/.
DB=$1
# Make our latest backup
/usr/bin/pg_dump -C $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