4 ms·
That’s really such a nice solution to the problem, nice. Can you imagine not reading the docs to discover those options. So you spin up a database to save stat
by corytheboyd 6y ago
That’s really such a nice solution to the problem, nice.
Can you imagine not reading the docs to discover those options. So you spin up a database to save state about runs to implement the delay. And you need a dashboard to monitor the various parts of the system for debugging.
Or you read the docs
- coldtea 6y agoOr you prefix your command / script with sleep and a randomlly generated 1h value!
- TimWolla 6y agoThis works, but compared to using systemd it has the drawback that the range of possible times is anchored to the configured time in cron. The systemd timer example I gave causes the next cycle to start when the previous job finished. So if it initially runs the script between 0:00 and 1:00 and the script takes 1.5 hours to finish then the next run will be between 1:30 and 2:30 the next day, instead of 0:00 and 1:00.
- MayeulC 6y ago> So if it initially runs the script between 0:00 and 1:00 and the script takes 1.5 hours to finish then the next run will be between 1:30 and 2:30 the next day Shouldn't it be between 1:30 ans 3:30? I'm just nitpicking, of course, that's a nice solution.
- TimWolla 6y agoYes, you are correct. The script ends no later than 2:30 and then there's a delay of up to 1 hour.