Cron backups for db-datanommer01.

This commit is contained in:
Ralph Bean 2014-01-10 21:29:20 +00:00
parent 18100deb21
commit 12b88b57a1
4 changed files with 21 additions and 0 deletions

View file

@ -32,3 +32,16 @@
- restart postgresql
tags:
- config
- name: Ensure postgres has a place to backup to
file: dest=/backups state=directory owner=postgres
- name: Set up some cronjobs to backup databases as configured
template: >
src=cron-backup-database
dest=/etc/cron.d/cron-backup-database-{{ item }}
with_items:
- "{{ dbs_to_backup }}"
when: dbs_to_backup != []
tags:
- cron

View file

@ -0,0 +1 @@
0 0 * * * postgres /usr/bin/pg_dump -C {{ item }} | /usr/bin/xz > /backups/{{ item }}-$(date +%F).dump.xz