star-drive-dist/db_backup_scripts
eleanor eb45d91d2e remove line from start of pg_backup_rotated.sh that was preventing the backups from running 2020-02-27 11:11:18 -05:00
..
README.md Useful database backup scripts. 2019-10-03 14:30:33 -04:00
pg_backup.config.example Useful database backup scripts. 2019-10-03 14:30:33 -04:00
pg_backup.sh Useful database backup scripts. 2019-10-03 14:30:33 -04:00
pg_backup_rotated.sh remove line from start of pg_backup_rotated.sh that was preventing the backups from running 2020-02-27 11:11:18 -05:00

README.md

Postgres Backup Scripts

https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux

Here are some scripts which will backup all databases in a cluster individually, optionally only backing up the schema for a set list. The reason one might wish to use this over pg_dumpall is that you may only wish to restore individual databases from a backup, whereas pg_dumpall dumps a plain SQL copy into a single file. This also provides the option of specifying which databases you only want the schema of. The idea is to run these in a nightly cron job.

pg_backup.config - The main configuration file. This should be the only file which needs user modifications. pg_backup.sh - The normal backup script which will go through each database and save a gzipped and/or a custom format copy of the backup into a date-based directory. pg_backup_rotated.sh - The same as above except it will delete expired backups based on the configuration.

Customization Notes:

We've altered the pg_back_rotated.sh script so that it can be run without a password prompt if executed as the postgres user. So we'd recommend running this as a nightly cron task, with something like.

30 2 * * * /var/www//var/lib/pgsql/