LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to set cron job to run every 5 mins? (https://www.linuxquestions.org/questions/linux-general-1/how-to-set-cron-job-to-run-every-5-mins-61667/)

gsbarry 05-25-2003 02:55 AM

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?

allo 05-25-2003 03:26 AM

Hello,

Perhaps */12

markus1982 05-25-2003 03:31 AM

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

markus1982 05-25-2003 03:34 AM

If you distro supports /etc/cron.d dir you could also use
Quote:

*/5 * * * * user_to_run_command_as command

gsbarry 05-25-2003 09:22 PM

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?

Artimus 05-26-2003 02:16 PM

Might I ask what the heck you are trying to accomplish?

iceman47 05-26-2003 03:22 PM

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.

purplesage 05-28-2003 12:30 PM

2-57/5 * * * * /path/to/command

--works for me

I'm running crond on RedHat


All times are GMT -5. The time now is 01:42 PM.