Operating System - HP-UX
1834249 Members
1976 Online
110066 Solutions
New Discussion

Re: Cron not running with rc=1

 
SOLVED
Go to solution
Dewa Negara_4
Regular Advisor

Cron not running with rc=1

Hi All,

Anyone can help me please? I still can not verify why one of my cron jobs is not running with rc=1. Below is the error from /var/adm/cron/log.

What does mean rc=1? How to resolve it?

Thanks and Best Regards,
Negara

> CMD: /home/ap1030/projects/ssh/check/check_ssh_dirk
> root 2784 c Thu Jun 17 07:00:00 EDT 2004
< root 2784 c Thu Jun 17 07:00:00 EDT 2004 rc=1
Santos
9 REPLIES 9
Hoefnix
Honored Contributor
Solution

Re: Cron not running with rc=1

Hi,

/home/ap1030/projects/ssh/check/check_ssh_dirk
returned with an error and did not finish correct. Check your script!

HTH,
Peter
Rajesh D L
Frequent Advisor

Re: Cron not running with rc=1

Hi,

This is output from your script. Not any cron error.

regards,
RDL.
Dewa Negara_4
Regular Advisor

Re: Cron not running with rc=1

Thanks. But why it was running well when I ran it manually.

When I put it on cron, it did not even create an empty log file. It looks like not running at all.

Thanks.
Santos
T G Manikandan
Honored Contributor

Re: Cron not running with rc=1

make sure that the first line of your script contains the env setup i.e you source your profile file.

When you run the script from Commandline if picks up the env. for the user.

Cron will not recognize this,you will have to source your env. settings file in your cron script
Sanjay Kumar Suri
Honored Contributor

Re: Cron not running with rc=1

Does the script has execute permission?

It seems that some commnad in the script has executed with a syntax error leading to a exit code=2.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Hoefnix
Honored Contributor

Re: Cron not running with rc=1

Check also if you use full path's in your script.

HTH,
Peter
Sanjay Kumar Suri
Honored Contributor

Re: Cron not running with rc=1

Correction to my previous post: exit code=1.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Mei Jiao
Respected Contributor

Re: Cron not running with rc=1

A few things to check too:
(1) Is the system trusted?
(2) Is the auditing turned on?
(3) Is the cronjob root's cronjob? Or user's cronjob?
(4) If root's cronjob, is the root belongs to the group root?
(5) If user's cronjob, is the script runable by the user?
(6) And like others have mentioned, your script must contain the shell environment etc.
Dewa Negara_4
Regular Advisor

Re: Cron not running with rc=1

Hi All,

Thanks for your help.

I just set up the environment again and it looks fine now.

Thanks again.
Best Regards,
Negara
Santos