- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- crontab */2 for HP-UX
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
04-03-2003 01:40 PM
04-03-2003 01:40 PM
Came across a reference in the ITRC forums to using */2 notation to schedule crontab for ever other minute. Tested in Linux and FreeBSD and works. Doesn't work in HP-UX or Solaris. Any reason why? How about a workaround?
*/2 * * * * echo `date` > junk
crontab: error on previous line; unexpected character found in line.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 01:45 PM
04-03-2003 01:45 PM
SolutionFor HP-UX and solaris, and to keep everything straight, I prefer the standard cron format:
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /path/to/job
That was there is no question as to when the job will run.
Another workaround:
# cat /path/to/job
#!/usr/bin/sh
....
stuff to do
....
at -f /path/to/job now + 2 minutes
The at statement will reschedule the job every 2 minutes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 01:53 PM
04-03-2003 01:53 PM
Re: crontab */2 for HP-UX
In actuality
*/2 should be every 30 seconds as it would be a minute divided by 2. But.. Someone elses logic dictated this change for their needs, some people thought it was cool so it was implemented in the gpl versions of cron.
A rule of thumb I have is to use standards. I write all scripts so that they port to any OS. I use my own wrappers for every script to handle path differences, but command syntax is globally accepted.
That being said, I'll warn you that I support HP, Sun, Irix, AIX, SCO, and Linux. It takes some getting used to to be able to do 1 job and have it be done on all of these variants, but it's definatly do-able and worth the efforts.
If you really need something to run every-other minute, then write it long hand as someone else mentioned. It's not a standard, and I dont forsee it being one any time soon.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 02:07 PM
04-03-2003 02:07 PM
Re: crontab */2 for HP-UX
Yes, was looking for shorthand for standard notation but guess there isn't if I'm sticking with standard cron.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2003 02:12 PM
04-03-2003 02:12 PM
Re: crontab */2 for HP-UX
Yes, would make more sense to do something like *%2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2003 12:53 PM - last edited on 04-18-2017 12:49 AM by Parvez_Admin
04-07-2003 12:53 PM - last edited on 04-18-2017 12:49 AM by Parvez_Admin
Re: crontab */2 for HP-UX
You got off light. I had the same question a week ago, but took a heap of abuse from the old timers. (see
[Broken link removed on <4/18/2017> by Mod]
. :>)
Short answer, HP-UX cron seems to stick with the most compatible (and documented)parameters, and the Linux flavor doesn't.
Best of luck,
-dd