The scripts in cron.daily
and the others are executed using run-parts
if anacron
is not installed. You can see this in /etc/crontab
:
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
run-parts
will execute each executable in the directory, and wait for each to complete before running the next. Here is a test using these two scripts:
$ cat cron/1test #!/bin/bash date echo script1 sleep 10 date $ cat cron/2test #!/bin/bash date echo script2 sleep 10 date
Output:
$ run-parts --verbose cron run-parts: executing cron/1test Monday 6 January 10:38:42 EST 2014 script1 Monday 6 January 10:38:52 EST 2014 run-parts: executing cron/2test Monday 6 January 10:38:52 EST 2014 script2 Monday 6 January 10:39:02 EST 2014
This differs from scheduling each job in cron, which will run them parallel if they overlap.