Closed MabezDev closed 2 years ago
Hi @MabezDev,
I am afraid fcron jobs are defined based on elapsed time XOR time of the day, but not both.
To do what you are after, I think you would have to be a bit more creative with the job scheduled based on one, and then doing the other check in the job itself, i.e.:
%nightly * 1-2 your-command
to run at the first opportunity between 01:00 and 02:59, and then your job checks whether 48h have elapsed (and wait if the 48h will occur before 3am). That's feasible if you are after the uptime (i.e. how long ago the OS last booted), but if you are after the run time (how long the system has been up and running, i.e. don't count the time it was sleeping on suspend) then I am not aware of a way to get that information easily from the OS (fcron has to work it out, it doesn't get it via a simple call to the OS).Ah, that's a shame!
Thanks for the workarounds, I'll see what I can do.
Hi,
Thanks for your work on fcron!
I have been pooring over the docs, and testing some setups locally but can't seem to get fcron to do what I'd like it to.
Goal
After X elapsed time, run a script in a given time window.
Example
@ 48h
of system uptime, run a backup script between 1am and 3am.I haven't been able to find the magic incantation to get this working (hopefully its possible!), I am hoping you could point me in the right direction.
Thanks!