Aug 12, 2011
tom

knowning how much time is left before cron weekly runs?

Question

I am on debian 6.

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

Answer

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.

Related posts:

  1. apache restarted/reloaded config by itself automatically, why?
  2. Weekly cron executing 2 times:
  3. Mounting cron configuration files – is it possible?
  4. Cron runs my script but script doesn’t do anything, something to do with mail error??? “got status 0x004b#012”
  5. What user do scripts in the cron folders run as? (i.e. cron.daily, cron.hourly, etc)

Leave a comment