cron.daily

James Gray james at gray.net.au
Tue Jan 9 07:26:54 UTC 2007


On Tuesday 09 January 2007 12:05, Scott Mazur wrote:
> On Mon, 8 Jan 2007 22:51:45 +0100, Bernhard Breinbauer wrote
>
> > Hi list!
> >
> > 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
> > Jan  8 07:41:26 localhost syslogd 1.4.1#18ubuntu6: restart.
> > 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:
> >
> > # ls /etc/cron.daily/
> > 0anacron  aptitude      find.notslocate  man-db            samba
> >  standard  tetex-bin apt       bsdmainutils  logrotate
> >  my_flexbackup.sh  slocate  sysklogd
> >
> > I have no clue what is wrong with my cron jobs.
> > When I execute the script manually it runs without error.
> > Any hints?
>
> Did you restart the crond service?  Normally cron looks for changes to the
> /etc/crontab file.  If this file hasn't changed, cron won't go looking for
> your changes until it gets restarted.  I was recently burned on this myself
> :)

Eh??

$ cat crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

...and from the crond man page:

Additionally, cron checks each minute to see if its spool directory's modtime 
(or the modtime on /etc/crontab) has changed, and if it has, cron will then 
examine the modtime on all crontabs and reload those which have changed. Thus 
cron need not be restarted whenever a crontab file is modified.

Whatever bit you, had little to do with restarting cron :)

Cheers,

James
-- 
A couple more shots of whiskey, women 'round here start looking good.
		[something about a 10 being a 4 after a six-pack?  Ed.]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1349 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20070109/5b480705/attachment.bin>


More information about the kubuntu-users mailing list