- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripts is not working in cron
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
тАО07-05-2007 02:26 AM
тАО07-05-2007 02:26 AM
I am running the bellow scripts in cron job its not working but when i ran in normal its working fine , can you pls help me to get resolve it.
$ more chkorainst
#!/bin/ksh
# Check for PGGPDM_D1.world Oracle instance
#echo "Timestamp: `date` STATUS: `tnsping PGGPDM_D1.world | tail -1`" >> /opt/ma
trix/admin_scripts/chkorainst.output 2>&1
echo "Timestamp: `date` STATUS: " >> /opt/matrix/admin_scripts/chkorainst.output
2>&1
exit
$ ./chkorainst
$ ls
chkorainst filesystemmonitor rbtmtr rbtwas rbtwas_old
chkorainst.output finalwarn rbtmtr.txt rbtwas.txt warn
$ more chkorainst.output
Timestamp: Thu Jul 5 10:05:35 EDT 2007 STATUS:
$ ./chkorainst
$ more chkorainst.output
Timestamp: Thu Jul 5 10:05:35 EDT 2007 STATUS:
Timestamp: Thu Jul 5 10:09:48 EDT 2007 STATUS:
Solved! Go to Solution.
- Tags:
- cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2007 02:45 AM
тАО07-05-2007 02:45 AM
SolutionMost cases this is attributed to environment variables - like PATH....
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2007 02:56 AM
тАО07-05-2007 02:56 AM
Re: Scripts is not working in cron
The most common cause for this not being able to run from cron is bcoz of the PATH.
edit the script and add the profiile, if user oracle is running this script, then
. /home/oracle/.profile
(absolute path of the user who is running the script )
this will provide all the needed PATH and ENV variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2007 03:03 AM
тАО07-05-2007 03:03 AM
Re: Scripts is not working in cron
Since echo is a shell builtin, that's not needed for it.
You are correct about the other causes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2007 03:06 AM
тАО07-05-2007 03:06 AM
Re: Scripts is not working in cron
As Geoff indicates cron jobs start out with limited environment set up. Your first step shoudl proabbly be to run a .profile or such to set up $PATH, $ORACLE_SID and so on.
There are many, many prior questions and answer about this in this very forum
To find those. Google: +cron +oracle +site:itrc.hp.com
For example:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=31119
If those answers fail to provide you with the help you need, then please be sure to re-reply with an exact description of why you think your job failed. Any particular error message? Can you cron a write with 'echo hello world'? Can you con a script to show the environement setup?
Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting