Don't do a backup if a precommand fails
andyundso opened this issue · 1 comments
Hi, many thanks for the role.
A bit of context: We use the borgbackup_pre_commands
variable to do SQL dumps of databases so we can includes those in the backup instead of the raw Postgres data directory. We recently noted an issue were the SQL dumps in the backups were empty because the command itself failed, but a new backup was still made every hour.
I would expect that the backup command fails if any precommand fail. I'm happy to contribute this change, but wanted to check with you if you would expect this behavior as well or if failing precommands should be an additional variable to toggle it.
I think it makes sense to let the backup fail if the precommand fails. It will probably help to detect issues like the one you mentioned.