Open chambm opened 5 years ago
If it helps anyone here's the lograte config file I put in /etc/logrotate.d to backup the DB:
/export/pg_backup/db-backup-hourly.sql.gz {
hourly
missingok
rotate 23
nocompress
nocreate
postrotate
sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-hourly.sql
sudo chmod 664 /export/pg_backup/db-backup-hourly.sql
sudo -upostgres gzip /export/pg_backup/db-backup-hourly.sql
endscript
}
/export/pg_backup/db-backup-daily.sql.gz {
daily
missingok
rotate 6
nocompress
nocreate
postrotate
sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-daily.sql
sudo chmod 664 /export/pg_backup/db-backup-daily.sql
sudo -upostgres gzip /export/pg_backup/db-backup-daily.sql
endscript
}
/export/pg_backup/db-backup-weekly.sql.gz {
weekly
missingok
rotate 3
nocompress
nocreate
postrotate
sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-weekly.sql
sudo chmod 664 /export/pg_backup/db-backup-weekly.sql
sudo -upostgres gzip /export/pg_backup/db-backup-weekly.sql
endscript
}
/export/pg_backup/db-backup-monthly.sql.gz {
monthly
missingok
rotate 12
nocompress
nocreate
postrotate
sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-monthly.sql
sudo chmod 664 /export/pg_backup/db-backup-monthly.sql
sudo -upostgres gzip /export/pg_backup/db-backup-monthly.sql
endscript
}
@chambm please see the new image 24.1. It also has a new PG version, I would be happy to accept a patch.
Possibly as a startup option. Saved to /export. I may implement this myself when I set up the 19.09 image on Jetstream, but I figure it'd be good to get comments.