Backups

This recipe does not cover backups. At the very least, you should have the cron task on the server running a daily backup. A simple and basic solution is to edit the crontab file as root by running crontab -e and adding the following lines:

@daily su postgres -c pg_dumpall | gzip >
/backups/postgresql-$(date +%u).dump.gz @daily tar czf /backups/odoo-filestore-$(date +%u).tgz
/home/odoo/odoo-prod/project/filestore

Don't forget to create the /backups directory. The backup files should not be stored on the same hard disk and, ideally, they would be mirrored on a server in a different physical location. Check these backups on a regular basis having backups that you can't restore when you need them is useless.

The proposed solution is to keep daily backups of the last seven days, which means you will lose one day of work if a problem arises. There are more advanced solutions available for PostgreSQL that allow point-in-time recovery. You can find more information about this in PostgreSQL 9 Admin Cookbook, by Packt Publishing. Similarly, there are many Linux tools, such as duplicity (http://duplicity.nongnu.org/), which you can use for file backups, allowing easy management.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset