- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: crontab erroring out with 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
08-10-2006 02:00 AM
08-10-2006 02:00 AM
crontab erroring out with rc=1
I am trying to run script through crontab but it is throwing following error.
CMD: . /data/vision/scripts/test.sh>>/data/vision/scripts/test.log
vision 13619 c Thu Aug 10 18:10:00 IST 2006
vision 13619 c Thu Aug 10 18:10:00 IST 2006 rc=1
------------
extract from cron.allow file
root
adm
uucp
applcrp1
vision
-------------
there is no cron.deny file
I am able to run the script from the command prompt.
Enclosed is the script.
Thanks in advance.
Siddharth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:04 AM
08-10-2006 02:04 AM
Re: crontab erroring out with rc=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:04 AM
08-10-2006 02:04 AM
Re: crontab erroring out with rc=1
Remember that a cron job has a very sparse environment. You should source the env vars you need for this script to run. And don't just run the .profile for that user unless you're sure that there are no routines that need a tty to execute.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:05 AM
08-10-2006 02:05 AM
Re: crontab erroring out with rc=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:05 AM
08-10-2006 02:05 AM
Re: crontab erroring out with rc=1
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:06 AM
08-10-2006 02:06 AM
Re: crontab erroring out with rc=1
Please take into account that crontab does not give to running scripts full environment, including PATH.
You have either in beginning of the script to execiute:
. ~/.profile , which is preferable
or to use full paths in each command.
Usually all cron scripts problems are connected to lack of environment.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:10 AM
08-10-2006 02:10 AM
Re: crontab erroring out with rc=1
Are you setting your ORACLE_SID in some wrapper script or within the cron line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:11 AM
08-10-2006 02:11 AM
Re: crontab erroring out with rc=1
30 * * * * . /data/vision/scripts/cp_arc_remote_loc_ver04.sh>>archive.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:15 AM
08-10-2006 02:15 AM
Re: crontab erroring out with rc=1
30 * * * * /data/vision/scripts/cp_arc_remote_loc_ver04.sh>>/tmp/archive.log
Assuming that the absolute path of the cp_arc_remote_loc_ver04.sh script is /data/vision/scripts/ !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:17 AM
08-10-2006 02:17 AM
Re: crontab erroring out with rc=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:26 AM
08-10-2006 02:26 AM
Re: crontab erroring out with rc=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:39 AM
08-10-2006 02:39 AM
Re: crontab erroring out with rc=1
Try that and see if it will tell you which command is failing.
Its almost got to be either a path issue, or possibly something from the .bashrc file that needs to be set up in the script for it to run
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 02:39 AM
08-10-2006 02:39 AM
Re: crontab erroring out with rc=1
#!/bin/bash -x
And redirect all output to a separate log file. e.g.:
30 * * * * . /data/vision/scripts/test.sh > /tmp/test.log 2>&1
What is in /tmp/test.log after that runs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 03:45 AM
08-10-2006 03:45 AM
Re: crontab erroring out with rc=1
surround those commands with something like
if [ -t 0 ]
then
tput
...
fi
or better still have your cron'ed script and .profile source a file which sets and exports the needed environment variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2006 09:37 PM
08-10-2006 09:37 PM
Re: crontab erroring out with rc=1
I have tried including the .profile and environment. Still no sucess. Enclosed is the debug file.