- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- crontab not working
-
-
Categories
- Topics
- Hybrid IT with Cloud
- Mobile & IoT
- IT for Data & Analytics
- Transformation
- Strategy and Technology
- Products
- Cloud
- Integrated Systems
- Networking
- Servers and Operating Systems
- Services
- Storage
- Company
- Events
- Partner Solutions and Certifications
- Welcome
- Welcome
- Announcements
- Tips and Tricks
- Feedback
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- Converged Data Center Infrastructure
- Digital Transformation
- Grounded in the Cloud
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- Networking
- OEM Solutions
- Servers: The Right Compute
- Telecom IQ
- Transforming IT
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Categories
-
Forums
-
Blogs
-
InformationEnglish
crontab not working
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-09-2011 12:37 AM
03-09-2011 12:37 AM
crontab not working
crontab not working
When i tried to run the script manually its working.
But in crontab its not running.
entry is::
13 13 * * 3 /usr/bin/sh /UX-DR/IS/syslog/Syslog_Analysis_Script.sh
every wednesday 01.13 PM i need to run.
Please help where i can check the error.
What may the possible error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-09-2011 01:04 AM
03-09-2011 01:04 AM
Re: crontab not working
Re: crontab not working
13 13 * * 3 /usr/bin/sh /UX-DR/IS/syslog/Syslog_Analysis_Script.sh 1>/tmp/Syslog_Analysis_Script.sh.out 2>/tmp/Syslog_Analysis_Script.sh
look for possible errors in that file. The most frequent problem with a cron script is, that it does not inherit the environmental variables from your shell. (like PATH)
So probably you forgot to use declaring commands with full path. But look at the output and you'll see the problem.
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-09-2011 10:02 AM
03-09-2011 10:02 AM
Re: crontab not working
Re: crontab not working
$ env > /tmp/mycommandline.env
and add that command to your script
env > /tmp/mycron.env
Then check that you are giving the full path to commands in your script.
Read the man page on cron, crontab for further information such as:
The shell is invoked from your $HOME directory with an arg0
of sh. Users who desire to have their .profile executed must
explicitly do so in the crontab file.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-09-2011 10:03 AM
03-09-2011 10:03 AM
Re: crontab not working
Re: crontab not working
1. File permission (execute permission).
2. Path of the script (specify the complete path), from your example the file should be located in root (/).
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-09-2011 10:30 AM
03-09-2011 10:30 AM
Re: crontab not working
Re: crontab not working
Is cron running?
ps -ef | grep cron
post
Check /etc/rc.config.d/cron
Make sure it is set to auto start.
/sbin/init.d/cron start
Also note that the environment on cron is different than the user environment.
PATH and such needs to be set in your script.
env > /tmp/env.txt
Good diagnostic tool for the script being run in cron
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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-09-2011 12:16 PM
03-09-2011 12:16 PM
Re: crontab not working
Re: crontab not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-10-2011 02:23 AM
03-10-2011 02:23 AM
Re: crontab not working
Re: crontab not working
This should work. Do you get any mail with any error messages?
Typically you don't need to use /usr/bin/sh in your crontab entry.
You should have "#!/usr/bin/sh" in your script.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2018 Hewlett Packard Enterprise Development LP