holland-backup / holland

Holland Backup Manager
http://hollandbackup.org
Other
152 stars 49 forks source link

Backup alerts failing for Postgres #353

Closed jrdnyquist closed 2 years ago

jrdnyquist commented 2 years ago

Holland Backup v1.2.10 running on Ubuntu 20.04.4 LTS

We've noticed that Postgres backup alerts are failing. The mysqldump plugin is looking for an error state and deals with it correctly. The pgdump plugin just throws its hands up and dies if there's an error, so the failed-backup-command command hook never runs. Here's what the backupset config looks like:

[holland:backup] plugin = pgdump backups-to-keep = 3 auto-purge-failures = yes purge-policy = after-backup estimated-size-factor = 1.0 failed-backup-command = /etc/holland/alert-pg.sh

[pgdump] format = plain

So the backup itself works properly but if you stop Postgres to test it fails and does not run the failed-backup-command. As a work around we're added a cronjob (timed properly with the holland backup cron) that checks if the latest DB dumps are less than 90 minutes old. If not, it runs the alert (failed-backup-command) script so we get notified.

jrdnyquist commented 2 years ago

Thanks @soulen3 !

soulen3 commented 2 years ago

@jrdnyquist Thanks for reporting this. Are you able to test the new version and confirm it's now working as expected?

jrdnyquist commented 2 years ago

Looks good!