- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron log showing error as rc=1
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 09:59 AM
тАО12-18-2008 09:59 AM
the user abcd has a cron file under /var/spool/cron/crontabs/abcd
The crontab entry in abcd is
01 19 * * * /home/abcd/script/auto_run_db_extract.ksh
Till Dec 12th the script was executing fine, but since Dec 13th the script is not working.
No changes made to crontab file or to the script.
Since Dec 13th the cronlog entry shows
> abcd 9475 c Thu Dec 11 19:01:00 CST 2008
< abcd 9475 c Thu Dec 11 19:02:52 CST 2008
> CMD: /home/abcd/script/auto_run_db_extract.ksh
> abcd 14909 c Fri Dec 12 19:01:00 CST 2008
< abcd 14909 c Fri Dec 12 19:02:08 CST 2008
> CMD: /home/abcd/script/auto_run_db_extract.ksh
> abcd 17734 c Sat Dec 13 19:01:00 CST 2008
< abcd 17734 c Sat Dec 13 19:01:00 CST 2008 rc=1
> CMD: /home/abcd/script/auto_run_db_extract.ksh
> abcd 17787 c Sun Dec 14 19:01:00 CST 2008
< abcd 17787 c Sun Dec 14 19:01:01 CST 2008 rc=1
> CMD: /home/abcd/script/auto_run_db_extract.ksh
> abcd 29078 c Mon Dec 15 19:01:00 CST 2008
< abcd 29078 c Mon Dec 15 19:01:00 CST 2008 rc=1
> CMD: /home/abcd/script/auto_run_db_extract.ksh
> abcd 17490 c Tue Dec 16 19:01:00 CST 2008
< abcd 17490 c Tue Dec 16 19:01:01 CST 2008 rc=1
> CMD: /home/abcd/script/auto_run_db_extract.ksh
> abcd 23858 c Wed Dec 17 19:01:00 CST 2008
< abcd 23858 c Wed Dec 17 19:01:00 CST 2008 rc=1
The script file contents is
______________________________________
if [[ -d /oracle/abcadmin/lost+found ]]
then
export ORACLE_BASE=/oracle/app
export ORACLE_HOME=/oracle/app/product/9.2.0
export ORACLE_SID=ICIPRDB
export SHLIB_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib32
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/rdbms/lib
export TWO_TASK=
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export PATH=$PATH:/usr/local/bin:$ORACLE_HOME:$ORACLE_HOME/bin:$ORACLE_HOME/lib:/usr/sbin:/etc:.:$ORACLE_HOME/OPatch
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib; export CLASSPATH
umask 022
`uname -n`'[${ORACLE_SID}]: $PWD> '; export PS1
NLS_DATE_FORMAT='Mon DD YYYY HH24:MI:SS'; export NLS_DATE_FORMAT
export NLS_LANG=american_america.AL32UTF8
sqlplus -S "reporting_user/fnsw@ABCPRDB" @/home/abcd/script/reporting_db_extract.sql
cp /home/abcd/data/receive/* /home/abcd/data/old_data
scp -rp /home/abcd/data/receive/* abcd@x.x.x.x:/home/abcd/data/receive
scp -rp /home/abcd/data/receive/* abcd@x.x.x.x:/home/abcd/data/old_data
rm -f /home/abcd/data/receive/*
else
exit
fi
_________________________________________
May I know why the script failed and what is the meaning of rc=1 in cron log file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:13 AM
тАО12-18-2008 10:13 AM
Re: Cron log showing error as rc=1
You can also try:-
# /sbin/init.d/cron stop
# /sbin/init.d/cron start
try PATH=${PATH}:${ORACLE_HOME}/bin
${PATH} is another way of writing $PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:15 AM
тАО12-18-2008 10:15 AM
Re: Cron log showing error as rc=1
Cron is telling you the return code (rc) of the last command. In your case the last command returned a value of one (1).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:19 AM
тАО12-18-2008 10:19 AM
Re: Cron log showing error as rc=1
The script file has not been modified till Dec13 and it has been working till then.
Also the cron is executing this file using /usr/bin/sh only.
With regard to path also the script is not modified. I dont know what happened all of a sudden.
Let me restart my cron and will let you know.
Thanks for your reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:30 AM
тАО12-18-2008 10:30 AM
Re: Cron log showing error as rc=1
>No changes made to crontab file or to the script.
So you may try to run the script independent of cron.
Also check the permissions for file if they might have changed, and your scripts might be failing.
And check if the directory for cron.allow and at.allow is "/usr/lib/cron"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:33 AM
тАО12-18-2008 10:33 AM
SolutionNothing has changed on your computer? A full filesystem (ie, /home), you have exceeded filesystem quotas, a change in the database logins, scp is failing due to a public key problem, etc... For most commands, the return code is the error number, also known as errno, and errno=1 means:
from /usr/include/sys/errno.h:
errno 1 = EPERM /* Not super-user */
[EPERM] Not owner. Typically, this error indicates an attempt
to modify a file in some way forbidden except to its
owner or the superuser, such as to change its mode. It
is also returned for attempts by ordinary users to do
things for which they need, but lack, a special
privilege.
Even though this is being run as root, your script depends on other subsystems such as sql and another computer. Don't run it in cron until you run it from a root login shell. And run it this way:
sh -x /home/abcd/script auto_run_db_extract.ksh
The -x will trace each step. If that works OK, put the line:
set -x
at the top of your script and let cron run it. You'll get an email with the trace and be able to see which line is failing.
> Also the cron is executing this file using /usr/bin/sh only.
It is a bad idea to allow any scripts without the #!/usr/bin... header line. Without this line, someday a script will be run from a non-standard shell and cause problems. Always include #!/usr/bin/sh for your POSIX shell scripts.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:35 AM
тАО12-18-2008 10:35 AM
Re: Cron log showing error as rc=1
I have rebooted cron. I need to wait till the server time tickles 19:01.
With regard to running the script manually,
the user is saying that the @ symbol in the following line is giving some error.
sqlplus -S "reporting_user/fnsw@ABCPRDB" @/home/abcd/script/reporting_db_extract.sql
I dont have the exact error message now. So what the user is doing is he logs on to sqlplus and does his tasks which goes smoothly.
I will let you know after 19:01 hrs CST.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 10:41 AM
тАО12-18-2008 10:41 AM
Re: Cron log showing error as rc=1
'stty -a' should show as:
kill = ^U -------->which is the default terminal setting.
& stty kill ^U
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 11:47 AM
тАО12-18-2008 11:47 AM
Re: Cron log showing error as rc=1
The user that is running this job needs to check their mail on the HP-UX system. Cron will send an e-mail to the user account that runs the job EVERY TIME it runs.
From this e-mail you should be able to see how / where it is failing.
I would modify the line in cron so that I get an e-mail after the script runs. Do something like:
01 19 * * * /home/abcd/script/auto_run_db_extract.ksh 2>&1 | mailx -s "Output from auto_run_db_extract.ksh cron job" user@domain.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 12:19 PM
тАО12-18-2008 12:19 PM
Re: Cron log showing error as rc=1
Actually, he said user "abcd" ran the job out of cron, so it gets id / permissions, correct?
I'd suspect a (possibly inadvertant) change in one of the directories noted for the "scp" or the "rm"....possibly others depending upon what's in "reporting_db_extract.sql"
also of note is the fact that the orignal script (or at least the portion posted) will *NOT* run if it can't find "lost+found", which makes absolutely no sense at all, as it doesn't use anything located there.
interesting that the original script is