Questions about backup schedule #332
-
I switched from cron based to "Max Frequency Days" or "Max Frequency Hours" in the hopes that it would be executed the number of days/hours after the last run, but it ignored the previous cron triggered backups and scheduled the next one 24h after I had saved the job. So the problem is, how do I make a plan execute say early morning without having to get up at 3am and saving the plan? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
If you want a backup to run at a specific time of day cron is the right solution, max frequency hours and max frequency days are for running an operation at a specified interval when you don't care about the exact time of execution. Prune and check operations are always scheduled relative to the last time the operation ran. Backup scheduling is somewhat special in that it is always relative to the current time -- this is to ensure you don't get a burst of operations running as soon as you boot up your computer if you've skipped a few backups, but I'm definitely open to discussion re: whether this is the right policy. So for max frequency hours / max frequency days this will always be after startup or config change. Cron behaves more expectedly for these backup operations. |
Beta Was this translation helpful? Give feedback.
-
Hm, maybe I'm complicating things. Can you advise on the best solution? At the moment I have 2 jobs which should run daily and one which should run weekly. The following additional criteria apply:
The backup durations vary. Sometimes its a matter of minutes sometimes up to an hour. I monitor my backups with healthchecks. On the healthchecks side, I can choose a schedule when to expect a successful completion trigger. The problem is, since I don't know when they'll finish, I at least need to know when they start. Anyway, I guess this weekend I am staying up till 3m and schedule them all as "Max Frequency Days" or "Max Frequency Hours" and set their schedule in healthchecks to every 7 days, grace 4h and every 24h grace 2h. That should do the trick. |
Beta Was this translation helpful? Give feedback.
-
One good option re: healthchecks is to proactively indicate failure e.g. per the example here https://garethgeorge.github.io/backrest/cookbooks/command-hook-examples#notify-a-healthcheck-service You can then set a quite large timeout like 24 hours or more to catch cases where backrest itself crashes (which should be very rare!). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the sample script. Until now, I was triggering a successful backup with the Condition_Snapshot_Success and if that didn't happen, it was obviously a fail. I will look into your example, that looks nice. The I will peruse the rest of the templating documentation and figure out a solution for myself :-) |
Beta Was this translation helpful? Give feedback.
-
Please excuse me, but I'd like to add another cron related question. |
Beta Was this translation helpful? Give feedback.
-
Can Healthchecks hooks be included natively? Greetings and good work |
Beta Was this translation helpful? Give feedback.
One good option re: healthchecks is to proactively indicate failure e.g. per the example here https://garethgeorge.github.io/backrest/cookbooks/command-hook-examples#notify-a-healthcheck-service
You can then set a quite large timeout like 24 hours or more to catch cases where backrest itself crashes (which should be very rare!).