Pre & Post Scripts
Hello!
Great job on this plugin!
Are you plannign on implementing pre/post sctipting?
My current Borg workflow involves waking up my backup server, creating the backups, then putting it to sleep.
This is achieved with wake and sleep scripts run before and after the backups.
Would love to use this plugin, but need some way to run scripts.
Thank you!
Thank you for the suggestion! We agree that pre/post scripts would be a useful addition, and we plan to implement this. Waking a backup server before a job and putting it back to sleep afterwards is a use case we want to support.
Our planned approach:
- Central script management under Settings, with a name, description, script content, and execution timeout. We plan to support Bash initially and validate syntax when saving, without executing the script. Syntax errors should include the line number; syntax validation cannot guarantee runtime success.
- Per-job selection of saved pre/post scripts in the job wizard, including execution order and their position in the workflow preview.
- Pre scripts run before the first required access to the backup server. A non-zero exit code or timeout prevents the backup from starting and marks the run as failed with a clear script error.
- Post scripts run after all Borg operations and after required network shares have been unmounted. A failed post script marks the overall job as failed, while preserving any successfully created backup. The history should distinguish a backup failure from a post-script failure.
- A per-job option controls whether post scripts run only after success or also after a failure/cancellation, so a server can be put back to sleep after an unsuccessful backup.
- Script failures must not prevent the existing recovery of containers and VMs stopped by the job. The final job status and notification should include the script outcome.
This will be integrated into the existing job runner. We do not have a release date yet; the implementation will first be made available through the test channel for validation.
@airbillion
Hi, could you please check the latest changes and let me know if the implementation meets your expectations? Are you happy with the solution, or is there anything you would like to see improved? Thanks for your feedback!
Hi, could you please check the latest changes and let me know if the implementation meets your expectations? Are you happy with the solution, or is there anything you would like to see improved? Thanks for your feedback!
Hi,
Thank you for takign the time to implement this feature!
Looks perfect!
Can't wait to test it out!
Thanks again!