Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron job will not run, RC=2 in log file

Status
Not open for further replies.
Nov 24, 2004
159
GB
Hi having a problem with cron, a particular script nolonger wants to run in cron, or should i say cron no longer wants to run a particular script

the error i get is:

CMD: /local/london/scripts/check_as400_reports.sh > dev/null 2>&1
as400ftp 13075 c Thu Oct 30 09:28:00 2008
as400ftp 13075 c Thu Oct 30 09:28:01 2008 rc=2

What is a RC=2 error?
 
forgot to add the cron entry

00 3 * * 1-5 /local/london/scripts/check_as400_reports.sh > /dev/null 2>&1
 
Are other jobs running OK? Is cron running?

I want to be good, is that not enough?
 
Other cron jobs are running fine, cron is running a stopped and restarted cron just to make sure.
 
Are you sure the file exists? A standard Return Code = 2 usually means "No such file or directory".

Ray

Even a bad day at the races is better than a good day at the office.
 
Either the script has an exit 2 in it or something in the script is exiting with ENOENT. Obviously, the easiest way is to change /dev/null to /tmp/myouput, and check it out.

A job can run find outside of cron, but not in cron.

Since it doesn't do a login, paths might be different, environment variables, shell variables, directory paths...
etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top