Closed NightTsarina closed 10 months ago
@NightTsarina With the last commits (the whole script was almost rewritten), the error handling was improved. In such case, despite the lack of disk space on backup storage, the mail will be sent to the administrator.
I'm closing this bug as it is already solved.
Note: this bug was also reported in Debian: #956083
Due to a human error, today I had to resort to backups to recover data from a PostgreSQL database. In the worst possible moment, I realised that ALL of the backups we had of this database are useless.
Turns out that when dumping the database to a huge text file, the system was running out of disk space, and so the file is truncated.
Instead of detecting the problem, aborting the backup, and sending an email to the administrator, autopostgresqlbackup assumes the dump finished well, proceeded to compress the truncated dump, and continued as if nothing had happened. This had been going on for months without me realising, and so I have no useful backup.
I believe this is critical, because this bug has made me lose real world data today.
The sad part is that the bug is pretty trivial to fix: all commands should be checked for non-zero return codes, probably by setting the '-e' flag at the beginning of the script.