7

Is there any difference between creating a CRON tab using 0/5 and */5? For example:

0/5 * * * *

vs

*/5 * * * *
1
  • 1
    crontab(5) says that steps (/N) are allowed with ranges and * is shorthand for the range first-last for that field. It doesn't say anything for steps without ranges, so I'd assume illegal syntax, or ignored.
    – muru
    Jun 17, 2015 at 16:24

1 Answer 1

6

This IBM support article explains how stepping works. In the case of */5, it would occur every 5 minutes (0, 5, 10, etc). That is the same as 0-59/5. In the case of 0/5, I just tested it and it will never run.

4
  • 2
    Nathan is correct but I think 0/5 used to work on some older OS or kernel.
    – Baazigar
    Jun 17, 2015 at 17:45
  • 1
    I think you are right. serverfault.com/a/583121/290434 says it would work, but that was not the case when I tried.
    – Nathan
    Jun 17, 2015 at 18:06
  • It works on some old versions of ubuntu. I have learned to hate ubuntu :D ubuntu is cool as a fanboy project and has no place in any enterprise production environment! Just because it CAN be used, does not mean it should be! Ubuntu is a massive fail at supporting older ubuntu versions, and also fails hard at integrating new packages. Ubuntu is just not a mature company and the makers do not seem to understand the needs of a persistent enterprise. Ubuntu will remain the fotm for fanboys only.
    – Baazigar
    Jun 17, 2015 at 18:11
  • Side note, 0/5 notation is supported on AWS Lambda. docs.aws.amazon.com/lambda/latest/dg/…
    – Saeven
    Oct 9, 2018 at 15:45

You must log in to answer this question.

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