Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am on debian 6.

Any way to see how many days are left before the cron weekly starts?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

The system crontab is usually defined in /etc/crontab/. It's here that the time interval for cron.weekly, cron.daily, etc is defined. My /etc/crontab/ looks like:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
 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 )

So my cron.weekly will run at 6:47 on the 7th day of the week.

Edit: The above information only applies to scripts in the /etc/cron.weekly directory. As pointed out by Iain, @weekly is defined to run at midnight on Sunday.

share|improve this answer

Yes, by doing this on the command line:

cat /etc/crontab

Somewhere in this file, you should see a line like this:

# m h dom mon dow user command

This describes the field order for each line below it. Otherwise, it's a whitespace-separated list, where each field goes in this order:

Minute, Hour, Day of Month, Month, Day of Week (where 0 or 7 is sunday and 6 is Saturday), Username to run command as, and Command to run.

There should be a line that ends in cron.weekly. This is your weekly run. By default this runs in the early hours of Sunday morning.

Also, try running this on the command line:

man crontab

share|improve this answer
1  
Actually, man 5 crontab. –  Dennis Williamson Feb 14 '11 at 17:03

I believe that @weekly is equivalent to 0 0 * * 0 so it runs at midnight on Sunday.

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.