- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- configuring cron job
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
тАО02-05-2006 06:34 AM
тАО02-05-2006 06:34 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 06:58 AM
тАО02-05-2006 06:58 AM
Re: configuring cron job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 07:07 AM
тАО02-05-2006 07:07 AM
Re: configuring cron job
The main problem when you write a script, which should run in crontab is environment, mainly PATH. When a script runs from crontab, it's PATH contains /bin and /usr/bin. Because of that, all commands should be used with their full path. In order to simplyfy the problem, put in the beginning of the script
. ~/.profile
or to create a file which contains all needed variables and download it.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 07:08 AM
тАО02-05-2006 07:08 AM
SolutionFirst, read the manpages for 'crontab(1)'. This is really quite explanatory.
Make sure that your login is allowed in '/var/adm/cron/cron.allow'.
Personally I prefer to write any current crontab to a file; edit that file; and lastly replace the current crontab file with the editted one. Others will use the direct edit option of 'crontab' using '-e'.
Thus, method-1 is:
# crontab -l > $HOME/crontab
[ edit $HOME/crontab ]
# crontab $HOME/crontab
Method-2 is:
# crontab -e
Method-2 simply invokes 'vi' using a temporary version of your crontab file (under the account you are logged into, of course). When you write/quit the editted version, your crontab is replaced.
My preference in using method-1 is that I mangle the editting in any way, I can simply discard the file, or write (save) what I have and fix it again before I apply it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 07:58 AM
тАО02-05-2006 07:58 AM
Re: configuring cron job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 08:21 AM
тАО02-05-2006 08:21 AM
Re: configuring cron job
25 02 * * * $HOME/tulip/sh
...where "*" means "every" and the fields are:
minute hour monthday month weekday command
Shiv, I encourge you to use the manpages as a resource. They are meant to be reference material and do assume some knowledge, *but* the more you read them, the more comfortable you will become with trying to read them. Usually you will find examples in the discussion which can be related easily to the initial synopsis (syntax).
The structure of the HP-UX manpages is described here (below). As a user and as an administrator, you will spend most of your time in sections 1 and 1M. A great deal of information on configuration files appears in section-4. Section-9 has a very good glossary.
http://www.docs.hp.com/en/B2355-60127/Introduction.9.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 02:41 PM
тАО02-05-2006 02:41 PM
Re: configuring cron job
25 02 * * * Full path to script 1>/dev/null 2>&1
Example:
25 02 * * * /home/shiv/tulip.sh 1>/dev/null 2>&1
See crontab man page more.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 02:50 PM
тАО02-05-2006 02:50 PM
Re: configuring cron job
You asked about, The scritp names is say "tulip.sh" and i want execute at 2.25am every day. what should be the syntax ?
25 02 * * *
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 04:15 PM
тАО02-05-2006 04:15 PM
Re: configuring cron job
My typical crontab looks as follows:
25 02 * * * /home/shiv/tulip.sh 1>/dev/null 2>&1
#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2006 04:18 PM
тАО02-05-2006 04:18 PM
Re: configuring cron job
A great introduction about "Cron"
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
-Arun