mojoconf / MCT

nothing to see here yet, move along
7 stars 1 forks source link

Set up backup #33

Closed jhthorsen closed 8 years ago

jhthorsen commented 9 years ago

We need to back up the pg db.

I'm thinking we could use https://spideroak.com/faq/questions/67/how_can_i_use_spideroak_from_the_commandline/ ?

Anyone with other ideas?

Are there other things that should be backed up? The only thing I can think that are dynamic, are the logfiles, but I don't think we need to back those up..?

jhthorsen commented 9 years ago

I tried doing something clever in crontab, but I don't understand why the jobs are not running:

$ crontab -l
#Ansible: backup mcr_production
0 * * * * /usr/bin/pg_dump -d mct_production 1>/home/www/backup/production/$(/bin/date +%FT%R).sql 2>/tmp/backup-production.log
#Ansible: purge old backup mcr_production
30 */12 * * * /usr/bin/find /home/www/backup -type f -mtime +1 -exec rm -f \{\} \; >/dev/null 2>/dev/null

See also https://github.com/mojoconf/mojoconf-ansible/commit/60e38ca42680f0a7257b9938d8c6eaab3d9b642c

marcusramberg commented 9 years ago

we've installed autopostgresqlbackup, which backs up the server to /var/lib/autopostgresqlbackup on a daily basis, and we're now rsyncing those backups out to a remote server in case of catastrophic failure.