cron.daily questions

D. R. Evans doc.evans at gmail.com
Fri Oct 6 22:06:14 UTC 2006


Derek Broughton said the following at 10/06/2006 11:25 AM :
> D. R. Evans wrote:
> 
>> Rob Blomquist said the following at 10/05/2006 09:31 PM :
>>
>>> For more on this, you can read the manpage for cron or crontab. Or go to
>>> one of the 86 million pages that show how to properly code cron commands.
>>> I always put the code in a top line of each crontab, so I don't need to
>>> see it every time I want to edit a crontab.
>> No no no. I know how to use cron :-) I just want to know how cron decides
>> that it's time to run the files in cron.daily. I can't find that info
>> anywhere I've looked. Which obviously means that I haven't looked in the
>> right place or come up with the right google search :-)
>>
> Rob was right, but pretty obscure.  Here's my /etc/crontab.  Clearer?
> 

OOoohhh!! /etc/crontab, not the crontabs for individual users. Right; got
it; so the daily stuff runs at 6:25am.

> derek at othello:~$ cat /etc/crontab
> # This file also has a username field, that none of the other crontabs do.
> 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    run-parts --report /etc/cron.hourly
> 25 6 * * *  root    test -x /usr/sbin/anacron ||  \
>  run-parts --report /etc/cron.daily
> ...
> -
>>>> 2. How do I find the output from the jobs that are run in cron.daily?
>>> Read up on cron, either in the man pages or on the web. If you have a
>>> functioning smtp server, cron can send an email every time it runs a job
>>> with the output from that job.
>>>
>> Yes, I know how to set up a cron job myself and how to put the uotput
>> somewhere (including e-mailing it to myself). What I don't know is where
>> cron puts the output in the absence of me doing anything.
> 
> Now you're just not paying attention.  In the absence of you doing anything,
> cron doesn't put it anywhere.  You MUST set up an smtp server if you want
> output, and if you have one you don't actually need to do anything - it
> will be mailed to root (though root may not be capable of receiving mail).


I beg to differ: I am paying attention :-) I have an SMTP server. I have
personal (and root) cron jobs that happily produce output.

The piece of information I was missing is that I am not missing anything :-)

In other words, what I didn't know was that output from cron.daily jobs
doesn't go anywhere into a log; if there is any output, it gets mailed to
root. And the fact that I'm not seeing any such mail means that tmpreaper
isn't producing any output. (This is different behaviour from other linuces
I have used; Mandriva, for example, puts cron.daily output in
/var/log/messages. One of the things that I have found unsettling with
Kubuntu is the sparseness of /var/log/messages -- not that it's a problem;
it's just different from what I'm used to.)

So now I know that there isn't some vital piece of information to help me
debug why tmpreaper doesn't seem to be doing anything being sent to a file
somewhere, I can proceed to debug tmpreaper the way I would have done in
the first place if I had known this: simply by running it manually with
lots of debugging.

(Except that I see that the tmpreaper file in cron.daily does more than
simply run tmpreaper :-( )

Anyway, now that I know I'm not missing some important piece of information
in a file somewhere, I can figure out what's going on.

Thanks very much.










More information about the kubuntu-users mailing list