Cosmic Wave
Cosmic Wave

Reputation: 3

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.

Upvotes: 0

Views: 45

Answers (1)

Nate Eldredge
Nate Eldredge

Reputation: 58493

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

Upvotes: 1

Related Questions