Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to run a crontab cron job which start at 5:30 AM and runs every 5 mins. How do i set it up in Linux?

I am able to give like below. But how do i make it 5:30 ?

*/05 5-16 * * *
share|improve this question
    
If you see my code, it ends at 4 PM –  Hacker Apr 7 at 6:03
    
Actually the last run will start at 5 minutes to 5 PM. When it ends depends on how long it runs. –  Anthon Apr 7 at 6:14
add comment

1 Answer 1

The */05 will match 5:00, 5:05 as well. You should make two entries:

30,35,40,45,50,55 5 * * *
*/05 6-16 * * *

(assuming you want it to run until 16:55 every five minutes after 5:30)

Alternatively you can use your original crontab entry and smarten up the script that is being called, to exit when run before 05:30.

share|improve this answer
    
just want to understand small thing. if i specify 6-16 will it run at 16:06,16:10 until 16:55 also ?? –  Hacker Apr 7 at 7:54
    
Yes. The first field matches the minutes, the second the hours. If you specify 6-16 for the hours and */5 for minutes then 16:05, 16:10, .. 16:55 matches the combination. I already commented on that below your original question. –  Anthon Apr 7 at 8:08
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.