LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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

Reply
 
Search this Thread
Old 05-25-2003, 03:55 AM   #1
gsbarry
Member
 
Registered: Jan 2003
Posts: 42

Rep: Reputation: 15
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?
 
Old 05-25-2003, 04:26 AM   #2
allo
Member
 
Registered: Jan 2003
Location: Toulouse, France
Distribution: slackware 8.1+
Posts: 35

Rep: Reputation: 15
Hello,

Perhaps */12
 
Old 05-25-2003, 04:31 AM   #3
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
well your syntax is WRONG. correct syntax would be (for each 5 mins, not limited to hour, day of month, month, day of week):
Quote:
*/5 * * * * command

Last edited by markus1982; 05-25-2003 at 04:35 AM.
 
Old 05-25-2003, 04:34 AM   #4
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
If you distro supports /etc/cron.d dir you could also use
Quote:
*/5 * * * * user_to_run_command_as command
 
Old 05-25-2003, 10:22 PM   #5
gsbarry
Member
 
Registered: Jan 2003
Posts: 42

Original Poster
Rep: Reputation: 15
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?
 
Old 05-26-2003, 03:16 PM   #6
Artimus
Member
 
Registered: Feb 2003
Location: Wisconsin
Distribution: Slackware
Posts: 188

Rep: Reputation: 30
Might I ask what the heck you are trying to accomplish?
 
Old 05-26-2003, 04:22 PM   #7
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
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.
 
Old 05-28-2003, 01:30 PM   #8
purplesage
LQ Newbie
 
Registered: May 2003
Location: Chicago
Distribution: RedHat
Posts: 1

Rep: Reputation: 0
2-57/5 * * * * /path/to/command

--works for me

I'm running crond on RedHat
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to run cron job fahad26 Linux - General 3 06-30-2005 02:51 AM
how to run this cron job ashley75 Linux - General 5 05-24-2004 12:20 PM
Howto run a job on a fixed time with cron? Schmurff Linux - Newbie 1 04-02-2004 04:31 AM
Did my Cron job run? ryedunn Linux - Newbie 2 02-25-2004 09:59 AM
Cron job does not run brentos Linux - General 6 12-12-2003 03:37 PM


All times are GMT -5. The time now is 09:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration