- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Cron Job Executing Script but Command not Work...
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
тАО08-17-2006 04:01 AM
тАО08-17-2006 04:01 AM
Cron Job Executing Script but Command not Working
I scheduled a cron job through SAM but it is not working.
The contents of the script are as attached.
Looking at the cron log it is executing the script and some features of it are working apart from the execution of the omnimm commands and I cannot understand why? The deletion of log files and emailing contents of new log files is working okay but the omnimm -repository_update does not seem to be hitting data protector at all. If I execute manually it is fine.
Im sorry but my HPUX knowledge is only basic.
Chad
- Tags:
- cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2006 04:04 AM
тАО08-17-2006 04:04 AM
Re: Cron Job Executing Script but Command not Working
try using the fully qualified path to omnimm.
Cron is limited in its shell functions..........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2006 04:05 AM
тАО08-17-2006 04:05 AM
Re: Cron Job Executing Script but Command not Working
cron has no environment.
That means you need to set the PATH and anything else you need in the script.
Quick and dirty:
env > /tmp/env
Put the critical parts of that in the script your cronjob calls.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2006 04:10 AM
тАО08-17-2006 04:10 AM
Re: Cron Job Executing Script but Command not Working
The answers already given regarding the use of absolute paths the definition of any environmental variables you need should rectify your problem. Please read the 'crontab(1)' manpages for more information there.
In addition, the use of the path '/bin' in HP-UX is deprecated. '/bin' is a symbolic (and transition) link to '/usr/bin'. You should use '/usr/bin/sh' for your POSIX shell.
Regards!
...JRF...
- Tags:
- tlink
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2006 04:10 AM
тАО08-17-2006 04:10 AM
Re: Cron Job Executing Script but Command not Working
export PATH=${PATH}:/opt/omni/bin:/opt/omni/lbin
Cron's environment (including PATH) is intentionally very sparse.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2006 04:22 AM
тАО08-17-2006 04:22 AM
Re: Cron Job Executing Script but Command not Working
This works fine now, I put in the full path in the script and this works fine now.
Thanks again. I will assign points now, all tiops helpful though even though I chose the path of just adding /opt/omni/bin in front of my commands.
I didnt know this was a problem with cron jobs.
Thanks,
Chad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2006 04:24 AM
тАО08-17-2006 04:24 AM
Re: Cron Job Executing Script but Command not Working
Chadders