Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-25-2003, 02:55 AM
|
#1
|
Member
Registered: Jan 2003
Posts: 42
Rep:
|
how to set cron job to run every 5 mins?
OK, I know to set like
0,5,10,15,20,25,30,35,40,45,50,55 run_command
is there any better syntax?
|
|
|
05-25-2003, 03:26 AM
|
#2
|
Member
Registered: Jan 2003
Location: Toulouse, France
Distribution: slackware 8.1+
Posts: 35
Rep:
|
Hello,
Perhaps */12
|
|
|
05-25-2003, 03:31 AM
|
#3
|
Senior Member
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467
Rep:
|
well your syntax is WRONG. correct syntax would be (for each 5 mins, not limited to hour, day of month, month, day of week):
Last edited by markus1982; 05-25-2003 at 03:35 AM.
|
|
|
05-25-2003, 03:34 AM
|
#4
|
Senior Member
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467
Rep:
|
If you distro supports /etc/cron.d dir you could also use
Quote:
*/5 * * * * user_to_run_command_as command
|
|
|
|
05-25-2003, 09:22 PM
|
#5
|
Member
Registered: Jan 2003
Posts: 42
Original Poster
Rep:
|
Hello,
If I want to start the job at every 5mins. But I want it to start from the second minutes of each hour. i.e. 2,7,12,17,....
How should I write?
|
|
|
05-26-2003, 02:16 PM
|
#6
|
Member
Registered: Feb 2003
Location: Wisconsin
Distribution: Slackware
Posts: 188
Rep:
|
Might I ask what the heck you are trying to accomplish?
|
|
|
05-26-2003, 03:22 PM
|
#7
|
Senior Member
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123
Rep:
|
Quote:
Originally posted by Artimus
Might I ask what the heck you are trying to accomplish?
|
The guy wants to run a script every 5 minutes starting from minute 2.
Why he wants to do it isn't really up to you now is it?
If you know the answer, simple tell him and make someone happy.
|
|
|
05-28-2003, 12:30 PM
|
#8
|
LQ Newbie
Registered: May 2003
Location: Chicago
Distribution: RedHat
Posts: 1
Rep:
|
2-57/5 * * * * /path/to/command
--works for me
I'm running crond on RedHat
|
|
|
All times are GMT -5. The time now is 11:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|