Search code examples
linuxcron

Crontab - differences between *, */1 and 0-59/1


Ensuring it needs to run every minute, what is the difference between these three commands?

* * * * * php /var/www/html/glpi/front/cron.php --force mailgate

*/1 * * * * php /var/www/html/glpi/front/cron.php --force mailgate

0-59/1 * * * * php /var/www/html/glpi/front/cron.php --force mailgate

Did the crontab run them differently or they are considered the same?


Solution

  • Those three crontab schedule expressions are all equivalent.

    * indicates "run every minute"

    */1 indicates "every minute that is divisible by 1" (so, every minute). Something like */2 would run every other minute.

    0-59/1 indicates "at every minute from 0 to 59 that is divisible by 1, run. It's the same as 0-59.

    https://crontab.guru/ is pretty great for translating crontab schedule expressions to plain English.