- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Script Retunns "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
Forums
Discussions
Discussions
Discussions
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
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
02-28-2006 09:39 AM
02-28-2006 09:39 AM
> larry 1355 c Mon Jan 23 22:00:00 PST 2006
< larry 1355 c Mon Jan 23 22:00:15 PST 2006 rc=1.
I'm on an n4000-55 running 11.11.
Any help would be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 09:49 AM
02-28-2006 09:49 AM
SolutionThis is the first offending line that I saw (but there may be many others):
Script_Dir=${HOME}/SQL
${HOME} is not yet set.
The solution when running under cron is to set and export these values very early in the script OR create a wrapper script that is called directly by cron; it's job is to set and export any needed variables and then call your "real" script.
you might do something like this in the wrapper script:
#!/usr/bin/sh
PATH=${PATH}:/usr/lbin:/usr/local/bin
HOME=/home/thisuser
typeset -i STAT=0
export PATH HOME
/xxx/yyy/realscript.sh
STAT=${?}
exit ${STAT}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 09:51 AM
02-28-2006 09:51 AM
Re: Script Retunns "rc=1"
#!/usr/bin/ksh
with the one below...
#!/usr/bin/ksh -x
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2006 10:39 AM
02-28-2006 10:39 AM
Re: Script Retunns "rc=1"
set -x
as the first line after #!. Now any error messages from your cron job will be emailed to the owner of the cron job. If mail is not setup or not convenient, just add the redirect codes to the cron job as in:
1 2 3 * * /home/user_name/myscript > /var/tmp/myscript.log 2>&1
Now, anything shown by your script will be redirected into the log file: /var/tmp/myscript.log
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2006 03:34 AM
03-01-2006 03:34 AM
Re: Script Retunns "rc=1"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 03:22 AM
03-07-2006 03:22 AM