Cronicle icon indicating copy to clipboard operation
Cronicle copied to clipboard

Feature Request: Catch up last scheduled event

Open Gabriele-Tomberli opened this issue 6 years ago • 3 comments

Hello,

I'm not sure if I understand the Catch-Up (Run All) flag correctly. From what I can tell, if there is an hourly job and Cronicle is not able to run for 8 hours, as soon as Cronicle starts it will catch up and execute those 8 missed executions right away. Is this correct?

My use case is the following: I run Cronicle on my home pc, with no reliable uptime. I would like to backup my SQL database once a day, and so I tentatively scheduled an event at 9PM daily. Now imagine I turn on my PC at 9:01 PM every day. Now the event will never be executed, is this correct?

If that is the case, I would obviously put the Catch-Up flag on this job, so that I'm guaranteed a backup as soon as Cronicle starts. However, executing 2+ backups at the same time doesn't make much sense, as the data would obviously be the same and the backup would be overridden.

I would basically like Cronicle to Catch up on the single last missed schedulation (per event) when it starts (if any). Is this possible?

Thanks for the amazing work, 😉

Gabriele-Tomberli avatar Feb 23 '20 12:02 Gabriele-Tomberli

Hello there! Yes, your assumptions are exactly correct, and the behavior is as you described. Unfortunately, there is currently no way to limit an event to only run once per day. Cronicle was really designed to run 24x7 on a dedicated server, so I never thought through this use case.

You may be able to hack something together using the Shell Plugin and something like:

DATE_STAMP=`date "+%Y-%m-%d"`

Then write that to a file, and compare it on each run, and if it's the same date, skip and don't run your command. I know, it's an ugly hack, but it's all I can think of.

I will definitely consider this for the major v2 redesign, which should be coming out sometime this year.

Thanks!

jhuckaby avatar Feb 24 '20 02:02 jhuckaby

Hi jhuckaby, and thanks for the response!

Cronicle was really designed to run 24x7 on a dedicated server, so I never thought through this use case.

I thought so, but I was slightly confused by the Catch all option :) I imagined in a 24x7 there would be no job to catch up.. 🙂

You may be able to hack something together using the Shell Plugin

Thanks for the suggestion, I'll try to hack something up!

Unfortunately, there is currently no way to limit an event to only run once per day.

I will definitely consider this for the major v2 redesign

I'm glad this request could be considered!

I'd imagine it could work in 2 ways:

  • A single flag, signalling that a job (in case it could not be executed by an host that is offline) should be queued until the next job (of the same event) gets scheduled. Eg. if the event is hourly, a job can get queued for up to 59 minutes. At most there would be 1 queued job per event.
  • A number input, specifying the grace time for a job, which is the amount of time allowed for a job to be queued waiting on the server to be up before being cancelled. In the precedent example, this would be like setting a 59 minutes grace time. This is more complicated to explain but gives the user more flexibility (not sure if it could be useful tho, as I cannot imagine an hourly job having a two hours grace time, for example). It has the added benefit of emulating the current catch all, by placing something like infinite grace time.

Just my 2c, 😉

Gabriele-Tomberli avatar Feb 24 '20 22:02 Gabriele-Tomberli

Is this request solved by using the Allow Queued Jobs and Queue Limit (of 1) settings, or will catch-up not support the Queue Limit setting?

It would make sense to me to have Queue Limit affect both catch-up and queued jobs the same way.

mbafford avatar Jan 17 '21 15:01 mbafford