[PLUG] cron question

Carlos Konstanski ckonstanski at pippiandcarlos.com
Fri Sep 21 03:33:19 UTC 2007


Richard C. Steffens writes:
 > Well, I'm finally getting around to trying out cron. Using crontab -e, I
 > created the following:
 > 
 > --------------------------------------------------------------------------
 > rsteff at Moonguide:~> crontab -l
 > # DO NOT EDIT THIS FILE - edit the master and reinstall.
 > # (/tmp/crontab.XXXXUbwmtI installed on Thu Sep 20 19:58:13 2007)
 > # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie
 > Exp $)
 > #
 > # turn on lights
 > #
 > 30 18 * * * /home/rsteff/ShellScripts/x10-lights-on.sh
 > 
 > #
 > # turn off lights
 > #
 > 59 23 * * * /home/rsteff/ShellScripts/x10-lights-off.sh
 > 
 > #
 > # testing
 > #
 > 59 19 * * * /home/rsteff/ShellScripts/x10-lights-off.sh
 > --------------------------------------------------------------------------
 > 
 > I added the "testing" section so I could watch the command execute. It
 > didn't. If I run the scripts directly, they work. Is there something
 > else I need to do for this to work automatically?
 > 
 > Protection on the files looks like this:
 > 
 > rsteff at Moonguide:~/ShellScripts> ls -l
 > total 8
 > -rwxr-xr-x 1 rsteff users 219 2007-09-20 19:35 x10-lights-off.sh
 > -rwxr-xr-x 1 rsteff users 214 2007-09-20 19:30 x10-lights-on.sh
 > 
 > -- 
 > Regards,
 > 
 > Dick Steffens
 > 
 > _______________________________________________
 > PLUG mailing list
 > PLUG at lists.pdxlinux.org
 > http://lists.pdxlinux.org/mailman/listinfo/plug

One thing to do when debugging cron-not-running issues is to tail the
syslog file (or less it and hit shift-f to put less in tail mode), and
watch what happens at the top of the minute after you make a change to
the crontab file.  If cron is running right, you should see a message
indicating that cron was updated.

Is cron actually running?  It is a service in /etc/init.d/.

Hava a look at the /etc/crontab file, just to make sure nothing is
funny there.  It's handy to add a MAILTO variable.  I have:

MAILTO=postmaster at pippiandcarlos.com

This makes cron use the local mail punter (ssmtp) to send the mail to
my mailserver, which delivers my cron mail to me (just as effectively
as postmaster spam reaches my inbox).  Getting the mail is an
important step.

Is the rsteff user in the cron group?  Whether this is necessary
depends upon distro.  In gentoo it is.

Maybe try putting jobs in /etc/cron.hourly to see if that part of cron
is working.

The crontab man page mentions cron.allow and cron.deny files.  Are
either of these present?

I recently had a machine whose vixie-cron would not work, just like
yours.  I ended up uninstalling and reinstalling it.  Then it worked.
-- 
Carlos Konstanski



More information about the PLUG mailing list