Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've tried to run a cronjob like this:

30/5 13-14 * * * ....

i.e I want to run the cron every 5minutes from 1:30PM to 2:30PM.

But it doesn't seems to work. Am I doing something wrong?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Use this syntax:

*/5 * * * * .....

But, the described situation needs to split the crontab entries in two:

30,35,40,45,50,55 13 * * * /your_job
0,5,10,15,20,25,30 14 * * * /your_job

Little more info:

The crontab looks like this:

(minutes) (hours) (day of month) (month) (day of week) (command)

Also you can use range of numbers (ex. 8-11) or list (ex. 1,2,5,10). More info you can find typing:
info crontab
In terminal.

share|improve this answer
    
I want to run the cron job from 1:30PM to 2:30PM after every 5minutes in between. –  joystick Nov 22 '12 at 8:30
    
See the edited post for your case. –  Frantique Nov 22 '12 at 8:45
    
Isn't there any shorter code to work with? –  joystick Nov 22 '12 at 8:48
    
I'm afraid this is the most self explicit method. –  Frantique Nov 22 '12 at 8:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.