Search code examples
linuxcron

How do I write a cron which run only on any hour and half (xx:30)


How to write a cron which run only on any hour and half (xx:30) ? For example it would run only at 00:30, 01:30, 02:30, on so on until 23:30.


Solution

  • The first field in a crontab entry is the minutes. You want your job to run whenever the "minutes" part of the current time equals 30, so you need a 30 in the first field. You want it to run at such a time regardless of what the hours, days, or months are, so you put * in the remaining fields.

    30 * * * * /my/job