- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Run command every 5 minutes
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
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-02-2005 04:58 AM
тАО02-02-2005 04:58 AM
Run command every 5 minutes
How can i add in cron to run a command after every 5 minutes
i Read from a web page that u can do this by this:
*/5 * * * * command
But it is not working. will it work on HP-UX
Or i have to use following:-
0,5,10,15,20,25,30,35,40,45,50,55 * * * * command
Pl. suggest on it
Thx
sanjeevg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 05:01 AM
тАО02-02-2005 05:01 AM
Re: Run command every 5 minutes
this will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 05:02 AM
тАО02-02-2005 05:02 AM
Re: Run command every 5 minutes
0,5,10,15,20,25,30,35,40,45,50,55 * * * * command
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 05:03 AM
тАО02-02-2005 05:03 AM
Re: Run command every 5 minutes
You can do the last, but you can also simply start the script and have a loop condition where it sleeps 300 (five minutes) then repeats . This can be set to stop at any given time, preferably just prior to your next cron execution of it.
Many options, I'm sure you'll get a response you can use.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 07:08 AM
тАО02-02-2005 07:08 AM
Re: Run command every 5 minutes
use cron to schedule a job every 5 minutes.
You need 0,5,10,15,20,25,30,35,40,45,50,55 * * * * command
Be aware, cron jobs have a limited environment setting. You may need to set your PATH and so on. Read the manpages.
The */5 construct is typical Linux cron.
If you use sleep 300, your job will sleep for 5 minutes, so it will start 5 minutes + the time it needed for execution later than the previous run. It would not be my first choice.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 01:34 PM
тАО02-02-2005 01:34 PM
Re: Run command every 5 minutes
The second is the true format to run a command every 5 minutes.
The format of cron job is:
minute hour day month date command
HMT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 02:14 PM
тАО02-02-2005 02:14 PM
Re: Run command every 5 minutes
#vi /var/adm/cron/log
2, command must be write in full format
*/5 * * * * /sbin/sh /path/yourshell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2005 04:32 PM
тАО02-02-2005 04:32 PM
Re: Run command every 5 minutes
#crontab -e
will open the crontab file
0,5,10,15,20,25,30,35,40,45,50,55 * * * * command
will run the command once in every minutes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 12:22 AM
тАО02-03-2005 12:22 AM
Re: Run command every 5 minutes
*/5 is Linux syntax and is not supported on HP-UX.
So on HP-UX you'll need to specify the exact times you want the job to run:
0,5,10,15,...
or 1,6,11,16,... whatever.
Maybe we'll get the */n syntax in a new HP-UX release some day.
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 02:06 AM
тАО02-03-2005 02:06 AM
Re: Run command every 5 minutes
Firstly,if this command will be run for a none root user then you have to modify
/var/adm/cron/cron.allow file and add this
user then;
an example of my user
0,5,10,15,20,25,30,35,40,45,50,55 * * * * (/usr/bin/ksh command)
Believe me mine is working properly...
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 11:37 AM
тАО02-03-2005 11:37 AM
Re: Run command every 5 minutes
Tx
Nair