Operating System - HP-UX
1753532 Members
5833 Online
108795 Solutions
New Discussion юеВ

what's means about return code of cron job

 
чОЛцЫж_1
Occasional Advisor

what's means about return code of cron job

hi expert,
I define a cron job, but it could not be execute, when i check the log file , i find an error message " rc=2", what's the return code means, if there any return code list of cron job??
thanks
6 REPLIES 6
twang
Honored Contributor

Re: what's means about return code of cron job

Massimo Bianchi
Honored Contributor

Re: what's means about return code of cron job

Hi,
which log did you check, the log of cron /var/adm/cron/log, or the log of your job ?

Are the patch of your cron job all absolute? This is a very common cause, because, cron has a very limited environtment.

HTH,
Massimo
Ralph Grothe
Honored Contributor

Re: what's means about return code of cron job

The return code (rc) should actually be the rc your cronjob, viz the program you have executed by cron (e.g. script, binary) is issuing as exit code.
Consult the docs of these programs (e.g. manpages) or have a look at the script (if cronjob is a script)
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: what's means about return code of cron job

If you haven't redirected stderr of the failing cronjob in your crontab look in the crontab owner's mailbox for mail, because the output will be sent to him.
Madness, thy name is system administration
Caesar_3
Esteemed Contributor

Re: what's means about return code of cron job

Hello!

Check your /var/adm/cron/log for more,
the rc is the return code of program that
cron executed.

Caesar
Cheryl Griffin
Honored Contributor

Re: what's means about return code of cron job

rc=2 is actually being returned from the shell not cron. It means that the script has failed.
Depending on what your cron job does, the reasons for failure can vary.
"Downtime is a Crime."