backrest
backrest copied to clipboard
Add retry strategy if hook cancels operation
Note: if you have a question or want discussion please post in the discussions area.
Is your feature request related to a problem? Please describe. I use backrest to backup an external SSD on a laptop. There is no guarantee that the SSD is plugged in/mounted. I want backrest to try and run a Backup at least once a day, if the SSD is available.
To check if the SSD is available, I use the following hook.
This works as a backup task will get cancelled if the SSD is not available. However the next task will then be scheduled based on the timestamp of the last cancelled run instead of the last successful run.
Describe the solution you'd like I would like backrest to retry a cancelled operation (this probably should include a delay).
Ideas how this could be implemented (not having thought it through completely):
- Add an additional error behaviour (
ON_ERROR_RETRY
) - Checkbox to schedule based on last successful task instead of any task
- probably requires a delay and is related to #372
- Being able to query the last successful execution of a backrest task and include this in the
CONDITION_SNAPSHOT_START
hook. This probably requires some addition to the template variables?
Additional context While I could partly deal with this issue by reducing the backup schedule do 1 hour intervals, this would lead to a lot of unneeded backup tasks (some cancelled, some actually creating snapshots).