New crontab not running

Mark Ovens mark at ukug.uk.freebsd.org
Sat Dec 23 19:16:31 GMT 2006


Hi,

I added a new cron several days ago - using ``crontab -e'' - to run 
portsnap every night at 3am but it has never run and I can't work out why.

/etc{148}# crontab -l
# Update ports tree
0 3 * * * root /usr/sbin/portsnap cron
/etc{149}#

As you can see, this was the first crontab added for root so 
/var/cron/tabs/root was created at this point.

Reading cron(8), it says:

Additionally, cron checks each minute to see if its spool directory's 
modification time (or the modification time on /etc/crontab) has 
changed, and if it has, cron will then examine the modification time on 
all crontabs and reload those which have changed.  Thus cron need not be 
restarted whenever a crontab file is modified.  Note that the crontab(1) 
command updates the modification time of the spool directory whenever it 
changes a crontab.

Firstly, which is cron(8)'s spool directory? Should there be a directory 
in /var/spool or is it /var/cron, or /var/cron/tabs? The timestamp on 
/var/cron/tabs was changed when the crontab was created:

/var{107}# ls -ld cron/ cron/tabs cron/tabs/root
drwxr-x---  3 root  wheel  512 17 Jan  2004 cron/
drwx------  2 root  wheel  512 20 Dec 15:03 cron/tabs
-rw-------  1 root  wheel  285 20 Dec 15:03 cron/tabs/root
/var{108}#

Since it didn't get run I restarted cron(8) (``kill -HUP'') last night - 
even though cron(8) says there is no need to - but checking now, it 
didn't run last night (i.e. 3am this morning) either.

There is nothing significant in /var/log/cron.

Can anyone shed any light?

Thanks.

Merry Christmas and a Happy New Year to everyone

Regards,

Mark




More information about the Ukfreebsd mailing list