I had to split some larger crons and an easy way was to just take the last two digits of the id. So id 10001 would run at the same time as 1,101,201,…1001,2001,etc.
Instead of a single cron taking hours to run, they now are split 100 times and run much more consistently.
However, how can I schedule a cron to run every 100 minutes, starting at x?
example:
php cron.cli 00 start at 12:01am and run every 100 minutes
php cron.cli 01 start at 12:01am
php cron.cli 02 start at 12:02am
. . .
php cron.cli 99 start at 1:39am
php cron.cli 00 start at 1:40am [looping every 100 minutes]
php cron.cli 01 start at 1:41am
I need cron 01 to start at 12:01am, cron 02 to start at 12:02am and cron 99 to start at 1:39am. And every hundred seconds afterward, respectively.
Can you help?
I would only write one entry into the crontab file. The one command would start the
cron.cliscript and passing the current time as a parameter.The
cron-cliscript then takes that parameter and creates the id in question out of it. That made, the file is much simpler to manage, as you won’t mess the crontab file with soo many entries. And imagine your 100 steps become 200 steps or even more … .