- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: query on crontab
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
тАО09-27-2009 06:56 PM
тАО09-27-2009 06:56 PM
I have written a script(pkg_check.sh) to monitor MC/ServiceGuard cluster status(down,halting,down..) which is attached with this thread. The Problem
is that when i run this script using "sh pkg_check.sh" command it works fine
but when i want to run this script using cron job only "cmviewcl -v
>/pkg_test/cluster_status.txt" command only work.Other part of this script
is not working. I have given following entry in the cron schedule:
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * su - root -c "/pkg_test/pkg_check.sh" 1>/dev/null 2>/dev/null
I have checked "/var/adm/cron/cron.allow".Here "root" user exist.I have already set
permission 777 of pkg_check.sh script. But no works.
Can any one help me that where is my problem??
Thanks
Minhaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2009 06:57 PM
тАО09-27-2009 06:57 PM
Re: query on crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2009 10:15 PM
тАО09-27-2009 10:15 PM
Re: query on crontab
Can you try putting the crontab entry under root like below
Login:- root
# crontab -e
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /pkg_test/pkg_check.sh
:wq!
I suspect you are ready under root, no need to su - root -c .. while crontab.?
also best place to check tunder cron.logs
cat /var/adm/cron/cron.log ?
HTH,
Rgds,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2009 10:19 PM
тАО09-27-2009 10:19 PM
SolutionEverything must use full path
and user privilege.
-I recommend use full path instead of relative path; for example use /usr/bin/date not date ..
-your script must have execute privilege.
and besides ,since I am not sure your syntax is correct; if you use user root you can enter like this ;
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /pkg_test/pkg_check.sh > /dev/null 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2009 08:45 PM
тАО09-28-2009 08:45 PM
Re: query on crontab
Minhaz