Post snapshot scripts

Looking in the documentation here:
UrBackup - Server administration manual (Section 6.4.1)
I see that to back up e.g. a non VSS aware database one can stop the service in the prefile or preimage scripts, & restart it in the post backup/image scripts.

However, this represents a long interruption to whatever service or process is stopped, it would be very useful to restart them as soon as the VSS snapshot completes rather than waiting potentially hours for the entire backup to finish.

I already asked about it:

I use postfileindex for start services back, but it runs not after snapshot was created, it runs after after indexing. Sometime it requre much time.
It would be very good if @uroni add “aftersnapshotcreated” option. I voted for it.

I wrote a ready-made script template for use this scripts (probably you will useful it):

That would be helpful for file backups & I’ll try to remember it is available for those, for a disk image, it’s not so helpful :frowning:

Since I’m running pretty much entirely Windows, the scripts would need converting from bash to cmd, I may have a look what I can do with them as a template, I’m sure they’re useful to those with Linux servers & clients though.

Depending on how reliable the database is I’d just back it up without doing anything else. The database should be in a crash-consistent state, i.e., as if you unplug the power and then start back up. If it is not a super unusual/bad (or tuned for performance at the cost of durability) database it should handle this.

@uroni Its MySQL and “Usually” it’ll recover from a sudden power loss, though not always & I’ve had to roll the database back to the last dump after a power outage before. Which resulted in purchase of a UPS. I got away with it last time I had to restore, & the image restore went perfectly, but it makes me nervous.

I don’t like relying on “usually”. I also back the machine up using other software which does allow stopping the db just for the snapshotting process, & I’d have used that backup as my fallback, the image made by UrBackup was newer.