Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If I place a shell script in /etc/cron.daily/, at what time of the day will it be executed?

share|improve this question

3 Answers 3

up vote 20 down vote accepted

Looking at /etc/crontab it should run at 06:25.

17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
share|improve this answer
    
This is most probably wrong because anacron is installed by default. The other answer is the correct one. –  user1455622 May 22 at 7:53

As indicated by other answers, the result depends on whether anacron is installed. On a desktop, it is installed by default, BUT crucially it is not installed in the server distribution. So the answer is around 06:25 on a server and about 07:35 on a desktop.

share|improve this answer

Approximately 7:35am, but the exact timing will depend on anacron.

By default cron delegates the running of /etc/cron.daily jobs to anacron. /etc/crontab contains the line:

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

but this defines the behaviour if anacron is not installed

With anacron installed, the running of cron.daily jobs is controlled by the entry in /etc/anacrontab:

1   5   cron.daily   nice run-parts --report /etc/cron.daily

which says run these jobs once per day, with a delay of 5 minutes.

anacron itself is run by cron, as specified in the file /etc/cron.d/anacron, which runs anacron at 7:30am.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.