crontab doesn't work

Kevin Kinsey kdk at daleco.biz
Fri Mar 24 21:53:54 UTC 2006


Rodrigo G. Tavares de Souza wrote:

> Hi,
>
>   Do I have to start something to crontab works?
>
> configuration file:
> #  MIN    HOUR   DAY/MONTH   MONTH   DAY/WEEK     USER        COMMAND
>   59      23         *        *        *         root        
> "/usr/local/etc/sarg/make-report"
>   0       0          *        *        0         squid       
> "/usr/local/etc/sbin/squid -k rotate"
>
>  It should generate a report every day, and clear
> the log file every week, but it isn't hapaning!
>  What do I suppose to do?
>
> Best regards
> Rodrigo Souza
> Analista Programador
> Sao Paulo - Brazil



Hello, Rodrigo

1.  Is cron running now?  Can you find any mention of
cron in your logs (esp /var/run/dmesg/boot)?  Does it
get mentioned in the boot process (watch the screen)...
cron should be started by init(8) as part of the rc(8) process
(the last of the boot stage, prior to going multi-user).

2.  Just out of curiousity and a desire to help, what's the
path to the "configuration file" above? :)

3.  Reasoning:  It appears that you have modified /etc/crontab. 
In BSD-land, you usually want to use the "root" crontab (which
is under /var/cron/tabs/root) or your personal account
crontab (/var/cron/tabs/username) to do cron work.
However, you don't want to edit this file directly.
Make sure $EDITOR is set to your favorite text editor
and run "crontab -e" to set up your crontab.  Exit
the editor, and crontab(1) will put the file in place for
you.  Incidentally, this may be the cause of your problem
entirely.  (See the FAQ, 10.3, 'Why do I get messages like
"root: not found" after editing my crontab file?').

4.  I'm sure you're aware of cron's limited $PATH and
other limitations.  Make sure your scripts are executable
and "shebanged", or else call them with the appropriate
shell interpreter's full pathname, e.g. (/bin/sh ~/scripts/mybackup.sh).

HTH,

Kevin Kinsey


-- 
	WARNING TO ALL PERSONNEL:

Firings will continue until morale improves.




More information about the freebsd-questions mailing list