Cron Syntax – Meaning of `* */1 * * *` Cron Entry

cron

Somehow, I am finding it difficult to understand tweaking around * parameters with cron.

I wanted a job to run every hour and I used the below setting:

* */1 * * *

But it does not seem to do the job. Could someone please explain the meaning of above and what is needed for the job?

Best Answer

  • * means every.
  • */n means every nth. (So */1 means every 1.)

If you want to run it only once each hour, you have to set the first item to something else then *, for example 20 * * * * to run it every hour at minute 20.

Or if you have permission to write /etc/cron.hourly/ (or whatever it is on your system), then you could place a script there.

Related Question