Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2006 15:52:35 -0600
From:      Kevin Kinsey <kdk@daleco.biz>
To:        "Rodrigo G. Tavares de Souza" <rodrigo@sensorsistemas.com.br>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: crontab doesn't work
Message-ID:  <44246A23.70905@daleco.biz>
In-Reply-To: <44245730.9030509@sensorsistemas.com.br>
References:  <44245730.9030509@sensorsistemas.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help
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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44246A23.70905>