Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm seeing slashes in some crontab examples, I don't understand what they mean?

Check this one out for example

*/10 * * * * /home/ramesh/check-disk-space

http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Depends on where the slashes are at.

The first occurrence is */10 which means every 10 and since it's the minutes column, every 10 minutes. It's shorthand for 0,10,20,30,40,50 in the minutes column.

The second through fourth, if you have to ask on those, hmmm... It's a path to the executable.

share|improve this answer
    
Here is another one I found runs on every 23 minutes past midnight every two hours "23 0-32/2 * * * /myscript" is this consistent with what you said? –  user893730 Mar 23 '12 at 2:47
    
In cron shorthand, the syntax is firstnum-lastnum/interval, with * standing for all available, ie in the minutes column * would equal 0-59. In the hours column, * would equal 0-23, I think the 32 is transposed. For the hours column, 0-23/2 should be the equivalent of */2. So if you wanted to fire something every two hours starting at 6 am and ending at 6 pm, you'd do something like 6-18/2 –  Fiasco Labs Mar 23 '12 at 3:41
    
Perfect, so whatever comes after / is interval –  user893730 Mar 25 '12 at 2:05

According to the example you posted, it executes that file, /home/ramesh/check-disk-space at the given time, where */10 means that every 10 minutes, of * * * * (The * means all the possible unit — i.e every minute of every hour through out the year, and follows this order: weeks, monthly, daily, and hourly)

share|improve this answer
    
This is a list of time parameters, whitespace separated -> */10 * * * * and this is a path -> /home/ramesh/check-disk-space which leaves the explanation that */10 is short hand for every 10 minutes and the other is a path to execute a command per the timesettings. –  Fiasco Labs Mar 23 '12 at 1:57
    
It's implied in the question that the user knows what cron is for so I think attempting to draw paralells between it and Scheduled Tasks, while true, is only confusing. –  ultrasawblade Mar 23 '12 at 2:43

Read title of p.7 of linked document "Schedule a Background Cron Job For Every 10 Minutes", also man crontab

share|improve this answer

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.