1

I read somewhere that you can add a cron job to run every minute like this:

#min hour day month weekday command
*/1   *    *    *    *     <your command>

What does the /1 part mean? Can I omit it?

0

2 Answers 2

3

That is the step value. so */2 means every other hour, */3 every third hour, etc. The default step is 1, so you can omit /1 if you want a step value of 1.

see the crontab(5) man page for more detail. man 5 crontab

3

man 5 crontab show that 'step values' can be used:

   Step values can be used in conjunction with ranges.  Following a range with
   '/<number>'  specifies  skips  of  the  number's value through the range.  
   For example, '0-23/2' can be used in the hours field to specify command execution
   every other hour (the alternative in the V7 standard is 
  '0,2,4,6,8,10,12,14,16,18,20,22'). Steps are also permitted after an asterisk, so if
   you want to say 'every two hours', just use '*/2'.

So in your case this is "run every minute". Most crons will use a granularity of 1 minute, so a * is exactly the same (and is actually more "portable" as not all cron servers support step values).

Not the answer you're looking for? Browse other questions tagged .