 shearerNorthern LightsPremium join:2002-06-18 Asia 1 edit | Debian - cron execution orderOn Debian, just suppose I have a crontab for root account like this:
jena:/home/shearerc# crontab -l -u root
# m h dom mon dow command
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 0 5 7 * scriptblablabla1
0 0 * * 0 scriptblablabla2
On July 5, 2009 (which is a Sunday), which task will cron execute first? I read man pages for cron & crontab but found no mention of execution order. thanks! |
|
 | top-down matching on those applicable to the current date/time. If it is 00:00 on July 05, 2009 then:
scriptblablabla1 will execute followed by scriptblahblabla2 |
|
 shearerNorthern LightsPremium join:2002-06-18 Asia | said by SirMeowmix_III :
top-down matching on those applicable to the current date/time Thanks. I had a feeling it was by alphabetical order... |
|
 | Not alphabetical, top-down based on the ordering in the respect crontab. |
|
|
|
 yockTFTCPremium join:2000-11-21 Miamisburg, OH kudos:3 | reply to shearer A note to the FreeBSD regarding general Cron behavior states that there is no determination of order for same time cron jobs.
»lists.freebsd.org/pipermail/free···538.html
That makes sense, considering the granularity available to you for scheduling. There are better ways than alpha-numeric sorting to order operations in cron. -- Have more fun with your GPS. Geocaching.com |
|
 | reply to shearer It's not processed alphabetically, it's processed in a top-down order based on the ordering in the respective crontab. Should "bla2" appear before "bla1" in the respective crontab it would be executed first. |
|
 | reply to shearer Yock has a good point, to be pedantic, it's top-down but execution is done serially, so bla1 and bla2 will run concurrently but when I was debugging cron bla1 is invoked first followed by bla2. |
|
 shearerNorthern LightsPremium join:2002-06-18 Asia | said by SirMeowmix_III :
... execution is done serially, so bla1 and bla2 will run concurrently but when I was debugging cron bla1 is invoked first followed by bla2. Does cron wait for bla1 to finish first before starting bla2? |
|
 yockTFTCPremium join:2000-11-21 Miamisburg, OH kudos:3 | No |
|
 nwrickertsand groperPremium,MVM join:2004-09-04 Geneva, IL kudos:7 | reply to shearer If order matters, then change the time of one of them to be sure that they run in the wanted order. -- AT&T dsl; Speedstream 5100b modem; openSuSE 11.0; firefox 3.0.11 |
|
 shearerNorthern LightsPremium join:2002-06-18 Asia | reply to shearer Ok - understood. Thanks all. |
|
 yockTFTCPremium join:2000-11-21 Miamisburg, OH kudos:3 | Understand that it makes no sense for it to wait. If you need one script to finish before another one runs, why not call it from the script you scheduled? -- Have more fun with your GPS. Geocaching.com |
|