1837516 Members
3772 Online
110117 Solutions
New Discussion

Re: crontab problem

 
Bob Slater
Occasional Advisor

crontab problem

I have been running a script out of the crontab for the last six years. It suddenly is not executing any more. What is the best way to trace the error?
10 REPLIES 10
RAC_1
Honored Contributor

Re: crontab problem

Did you check error messages in /var/adm/cron/tmp directory. Can you add debugging in script (set -vx) and try to run it manually. Does it run?
There is no substitute to HARDWORK
Yogeeraj_1
Honored Contributor

Re: crontab problem

hi,

check if the daemon is running by:
ps -ef|grep cron

if not running, start it using:
/sbin/init.d/cron start


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Bob Slater
Occasional Advisor

Re: crontab problem

Sorry, I didn't and should have mention the fact that the other scripts in the cron tab are running as normal. The only reference I have found to this script was in the dead.letter file (next problem after I get past the cron problem) shown below.

> CMD: /batch/dbcpflor #
> root 11865 c Fri Aug 25 12:45:00 CDT 2006
< root 11865 c Fri Aug 25 12:45:02 CDT 2006 rc=1
James R. Ferguson
Acclaimed Contributor

Re: crontab problem

Hi Bob:

The return code of one (rc=1) indicates a failure in your script. Are any of your filesystems full?

Regards!

...JRF...
john korterman
Honored Contributor

Re: crontab problem

Hi Bob,

it is also a good idea to check the mail of the user running the cronjob, as it will usually hold an error message.

regards,
John K.
it would be nice if you always got a second chance
Bob Slater
Occasional Advisor

Re: crontab problem

I found a small problem in the script but it did run manually. I fixed the syntax problem and now I get:
> CMD: /usr/bin/dbcpflor #
> root 24780 c Sat Aug 26 07:45:00 CDT 2006
< root 24780 c Sat Aug 26 07:45:00 CDT 2006 rc=127
Steven E. Protter
Exalted Contributor

Re: crontab problem

Shalom Bob,

Still gotta work on that script.

Something basic that was there the past 6 years is no longer there. it could be a filesytem of folder got moved.

I suggest you add this right after the shell:

set -x

Route the output of the script to a file. You should be able to debug and correct the situation from there.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jayasuntar
Valued Contributor

Re: crontab problem

Dear Slater,

Please login as root, and check the mail with mail command.

The crontab error will be sent to root thro mail. So please check the mail and find out the error, then you can fix the problem.

Regards

Jay
john korterman
Honored Contributor

Re: crontab problem

Hi again,

check doc id HPUXKBRC00001849
in the tech base.

The document suggests "cannot fork". Perhaps your system is overworked?


regards,
John K.
it would be nice if you always got a second chance
Bob Slater
Occasional Advisor

Re: crontab problem

I obviously have done something wrong in adding the set -vx to the script or I have it in the wrong sequence since it does nothing. And to answer another question, I did run the script manually and it runs without an error (that is what has me so confused).