[SUMMARY] cron not submitting jobs

From: Ken Brown <ccksb_at_trentu.ca>
Date: Wed, 29 May 1996 15:25:56 -0400 (EDT)

Hello,

First of all, thanks for the *numerous* replies. Secondly, this problem
arose largely, I believe, because of my familiarity with Ultrix, and lack of
same with dUNIX.

The main focus of the answers was to use "crontab -e" to uptade and submit
jobs to cron. The best summary I can provide is the response from
Linda.Perkal_at_iv10.bka.bka.ada.at (note that we're talking about root's jobs,
you can substitute "whatever-user" for root as you see fit);
------------------------------------------------------------------------------
1. RTFM
2. Do not edit the /usr/spool/cron/crontabs/root file
3. Do not kill the cron job and restart it
4. Login as root
   put the actual crontab to a temporary file
   $> crontab -l > /tmp/tempfile
A
5. edit /tmp/tempfile with your prefered editor (for example)
   $> vi /tmp/tempfile
6. submitt your cronfile with
   $> crontab /tmp/tempfile
7. check your crontab
   $> crontab -l
8. check your crontab submission time
   $> crontab -v
9. If you want to try it, give the crontab more than 2 minutes, i.e.
   if it's 9:03 am when you submit it, don't try to submit a job with
   04 09 * * * /tmp/myjob
10.Do not use ranges in your crontab, i.e.
   00 23 * * 1-6 /tmp/nightjob
   Try a listing instead, i.e.
   00 23 * * 1,2,3,4,5,6 /tmp/nightjob
11.Check that a path is set within the shellscript your trying to execute, i.e.
   #!/bin/sh
   # /tmp/myjob
   # Ken crontab-Testjob
   PATH=/bin:/sbin:/tmp
12.Read root mail; the standard output and error from cron land there.
------------------------------------------------------------------------------

Wayne.Jennings_at_jcu.edu.au adds the following important comments;
------------------------------------------------------------------------------
Make sure you execute the cron job as something like:

full_path/program > full_path/log 2>&1

Remember also that executions from cron are not the same as executions
from the command line. It does not execute .cshrc or .login of root or any
user you might want it to run as. Basically everything required should be
defined in the program or shell script you are running from cron.

PS. The reason I suggested you run anything in cron as:

full_path/prog > full_path/log 2>&1

Is that you can then have a look at the log file to see if there was an
error and you can catch the reason why it did not run. There have been
many times when you think cron is not working but it was an error that was
the problem. A PATH or environment variable not set.
------------------------------------------------------------------------------

Thanks again...hope this helps others.
----------------------------------------------------------------------
Ken Brown / kbrown_at_trentu.ca / tel: (705)748-1540 / fax: (705)748-1635
----------------------------------------------------------------------
Received on Wed May 29 1996 - 21:48:01 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT