Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jan 2000 14:57:31 -0600 (CST)
From:      Ryan Thompson <freebsd@sasknow.com>
To:        Pekka Savola <Pekka.Savola@netcore.fi>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Huge crontab jobs are not run
Message-ID:  <Pine.BSF.4.10.10001021443080.33656-100000@sasknow.com>
In-Reply-To: <3.0.6.32.20000102140829.008136d0@netcore.home>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 2 Jan 2000, Pekka Savola wrote:

> >Well, I'd guess you're looking in the wrong place.  This has nothing
> >to do with cron.
> 
> Sorry, I don't quite understand this.  If this has nothing to do with
> crontab, *what* does it have to do with then?
> 
> I run /usr/local/sbin/logrotate from the shell:
> 
> bash-2.03# /usr/local/sbin/logrotate
> [works fine]
> 
> I add it to /etc/crontab:
> 
> 1       0       *       *       1       root    /usr/local/sbin/logrotate
> [Won't be run]
> 
> I fail to see what *could* be wrong with the script because it works on an
> interactive shell session just fine.
> 
> Any further ideas?
> 
> Pekka Savola			pekkas@netcore.fi
> ---

Hi, Pekka;

I'm just going to state a few obvious, general hints that you may or may
not already know.  Hope this helps.


minute    hour    mday    month   wday    who     command

> 1       0       *       *       1       root    /usr/local/sbin/logrotate

This job will run 1 minute after midnight on day 1 of the week (I believe
this would be monday morning.  Sunday would be 0). With the job defined
this way, it will only run when those conditions are satisfied.  (i.e.,
Monday morning at 12:01).  If it's not Monday morning at 12:01, your job
won't run :-) 

Did you kill -HUP cron?  If you didn't do this (or reboot the system),
your job won't run.  

Since you can run it from bash just fine, as someone has said, check your
environment variables.  Off hand, I don't know which log rotator you're
using, here (there are several :-)  So, besides the path, see what other
environment variables might apply to your situation and put them in
/etc/crontab.  I can't help you with configuring logrotate, because I
don't run it.  Just have a look at root's environment from a shell (since
logrotate works fine from there), and copy any obvious environment
settings to /etc/crontab.  Checking the documentation for your log program
couldn't hurt, either :-)

And, someone has already suggested checking root's mail.  Further to that,
look at the full mail headers of the cron job (and any other cron jobs)
and look for the X-Env: field(s), which show you exactly what environment
variables are being used.

- Ryan

--
  Ryan Thompson <ryan@sasknow.com>
  SaskNow Technologies     http://www.sasknow.com
  #106-380 3120 8th St E   Saskatoon, SK  S7H 0W2





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001021443080.33656-100000>