Exit codes and post run scripts question

I had some questions that I didnt see in the guide.

  1. Do the post run scripts depend or know about the status of the backups? Or does say the post-backup script run regardless of the backup being successful or not with no notification of success or failure?

  2. When running as cron, do the exit codes also reflect true success or failure, eg exit 0 only if all VMs backed up successfully?

My goal/hope is to use healthchecks.io to make sure the cron is running successfully and the backups are completing successfully, but that would mean I need some way of only executing wget when the backup was successful.

The post run script runs only if the backup is successful.

Yes, the exit code will be non-zero if there is an error (regardless of whether it is running in a cron job or a normal script).

Perfect, thank you for the confirmation!

@thedge How is this working for you? Could you possibly share your script or detail on how you are using healthchecks.io to monitor the cronjob? Much appreciated…

It is working great. Easy to setup as well.

Sign up for a healthchecks.io account, there is a free tier.
Create a check. You can use Cron schedule or the regular, but the regular can cause false failures if you run your job manually sometimes as the next day will be out of order.
Itll give you a ping URL that is unique to your check, like this but longer.
You set a job period that matches your Vertical schedule (ex 1 day) and a grace period of a bit longer than your backup takes. If the post-backup script doesnt run inside that schedule+grace period then you get alerted.

On your server running Vertical, create a file “post-backup” (no extension) with the below in it and make it executable (chmod +x). It goes in the .verticalbackup/scripts folder.

wget http://hc-ping.com/a184 -O /dev/null

Save it and youre set.

Note that the version of wget on most ESXi versions does NOT support SSL but thankfully Healthchecks has an http endpoint that works with the same URL they give you.

You can also create a pre-backup script that tells Healthchecks that you are starting the job, same URL with /start on the end.

wget http://hc-ping.com/a184/start -O /dev/null

Healthchecks sends email but also has an integration with PushOver, another favorite service of mine for push alerts to my phone for things like this.

@thedge amazing! thank you so much, got it working - this is the missing piece to VB that will let me sleep at night… P.S. yeah Pushover is great, I use it too!