- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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
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
05-13-2005 05:15 AM
05-13-2005 05:15 AM
crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:21 AM
05-13-2005 05:21 AM
Re: crontab
Example
0 1 15 * * /usr/local/bin/my_script
Execute /usr/local/bin/my_script at 0100 hrs on the 15th day of every month.
0 1 * * *
execute everyday at 0100 hrs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:21 AM
05-13-2005 05:21 AM
Re: crontab
########################################################
# Check to see if it's necessary to make a new recovery tape
#
00 05 * * 1 /opt/ignite/bin/check_recovery
#
would run check_recovery at 5 minutes after midnight on Monday.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:27 AM
05-13-2005 05:27 AM
Re: crontab
You should do something like this:
Login (or su) as the appropriate user.
crontab -l > /var/tmp/mycrontab
edit /var/tmp/mycrontab to add an entry as indicated in the above responses.
crontab < /var/tmp/mycrontab
Running the crontab command without -l has the effect of reading stdin and sending a SIGHUP to the cron daemon to let it know it should reread the file. Man crontab for details.
A common error when building scripts that are run by cron is not explicitly setting and exporting needed environment variables (including PATH) in the script itself. Cron has an intentionally very sparse environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 06:05 AM
05-13-2005 06:05 AM
Re: crontab
crontab -e
when editing...
Here's a sample entry:
0 6 21 * * [ -d /var/adm/lp/XEBEC ] && /usr/local/bin/lpqpurge >/tmp/lpqpurge.cronlog 2>&1
What it does:
at 6 am on the 21st day of every month, it checks to see if the filesystem /var/adm/lp/XEBEC exists - if yes - it then executes the script called /usr/local/bin/lpqpurge.
the >/tmp/lpqpurge.cronlog 2>&1 tells cron to send any output and / or errors to a logfile called /tmp/lpqpurge.cronlog
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2005 10:12 PM
05-14-2005 10:12 PM
Re: crontab
MHDMW - mad husband doubt mad wife :)
- minute hour day month week.
Remember if you donot redirect your command outputs/error, by default crond will mail the respective owner.
A bit of advice always use "crontab -e" to edit a cron entry entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2005 07:10 AM
05-15-2005 07:10 AM
Re: crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2005 01:35 AM
05-19-2005 01:35 AM
Re: crontab
put this heading in your crontab:
##############################################################################################
## minute hour day_month month_year day_week program [argument(s)] ##
## (0-59) (0-23) (1-31) (1-12) (0-6 with 0=Sunday) ##
##############################################################################################
Paul.