cron.daily

Derek Broughton news at pointerstop.ca
Tue Jan 9 14:06:53 UTC 2007


Scott Mazur wrote:

> On Mon, 8 Jan 2007 22:51:45 +0100, Bernhard Breinbauer wrote
>> 
>> I'm having a problem with a daily cron job. I would like to execute
>> my backup script every day, therefore i copied it into /etc/cron.daily:
>> # ls -l /etc/cron.daily/my_flexbackup.sh
>> -rwxr-xr-x 1 root root 9704 2006-12-11 15:04
>> /etc/cron.daily/my_flexbackup.sh
>> 
>> But it isn't executed, anacron puts the following in /var/log/syslog:
>> 
>> Jan  8 07:38:30 localhost anacron[5005]: Job `cron.daily' started
>> Jan  8 07:38:30 localhost anacron[6705]: Updated timestamp for job
>> `cron.daily' to 2007-01-08
>> Jan  8 07:40:01 localhost /USR/SBIN/CRON[7152]: (root) CMD
>> (test -x /usr/sbin/mcelog -a ! -e /etc/mcelog-disabled &
>> & /usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog)
>> Jan  8 07:41:25 localhost exiting on signal 15

Is this your backup?  Clearly, it failed (or at least was terminated).

>> Jan  8 07:41:36 localhost anacron[5005]: Job `cron.daily' terminated
>> Jan  8 07:41:36 localhost anacron[5005]: Normal exit (1 job run)
>> 
>> As you can see anacron says "1 job run" but there are more files in
>> my cron.daily directory:

There is however only 1 _anacron_ job - that is "cron.daily".  If it was
also running other anacron jobs at the same time, you'd get a higher count.

>> I have no clue what is wrong with my cron jobs.
>> When I execute the script manually it runs without error.
>> Any hints?

Make it output _anything_ in the script, and you'll get that emailed to you
(always assuming you have email on the local machine).
> 
> You should also note that anacron and cron are two different tools.

Yes, but anacron's primary purpose (ie, what it does automatically as soon
as it is installed) is to run cron jobs that have been missed when the
system is down.
-- 
derek





More information about the kubuntu-users mailing list