[SOLVED] log-end hook does not causes error when exiting with non 0 exit code

Nov 27, 2023
193
42
28
Netherlands
daniel-dog.com
Hello everyone,

I am almost ready to put my custom backup script into production.
The script will upload the backups for me to an 3S Compliant provider on the log-end hook.
I do this to allow the VM to come out of the backup state and go back to its normal running state. (Since it suspends the VM untill it is past the backup-end hook.)

I noticed however that when I exit the script with any exit code that is not 0, it still tells me in the GUI, the backup was successfull. (Instead of marking it red and thus letting me know something went wrong.)

This is an issue since this will also not notify me via email when the backup fails to upload as it is never marked as unsuccessfull.

Does anyone know if this is expected behavior and if it is how I can still get it marked as failled so that it can email me. (So that it does not need to email me everytime a backup runs and instead allows me to only email me when an backup job got an error.)
 
Hi,
failure during the log-end hook is not considered a hard failure. The hook is intended to upload the backup log only. I'd suggest you upload the backup already during the backup-end hook, because a failure there will cause the backup job to be considered failed.
 
Unfortunaly this does not seem to be an option for me.

Since (for as far as I understand) it keeps the VM suspended untill it is passed the backup-end stage.
Uploading the backup to S3 takes 20 to 30 minutes so keeping it suspended for that long causes a lot of disruption for our database VMs. (In addition to the time it takes to backup the VM ot begin with.)

But is there maybe an option (since it still exits with a non 0 exit code) to get an email notification on log-end failure when it fails on log-end or is this also only triggered on a critical failure?
Since for me, the email notification is the most important thing. (So that I know that I need to investigate why the backup did not go as planned and so that it does not spam my email inbox with successfull backup logs.)
 
  • Like
Reactions: Daniel_Dog
Oke, in that case I can just add the upload code in the backup-end stage and thus solve the issue.
And this would also mean that the backup icon next to the VM is just to indicate that it is doing a backup at that moment?
Since it disappears after the backup-end stage (and the reason why I assumed it kept the backup suspended untill it was past this stage.)
 
Oke, in that case I can just add the upload code in the backup-end stage and thus solve the issue.
And this would also mean that the backup icon next to the VM is just to indicate that it is doing a backup at that moment?
Since it disappears after the backup-end stage (and the reason why I assumed it kept the backup suspended untill it was past this stage.)
Yes, the backup icon/lock is set until that point. It means you cannot do other operations like migration or disk resize with the VM during that time. But the VM itself can do I/O just fine.