How would I get a cron job to run every 30 minutes?
If your cron job is running on Mac OS X only, you may want to use launchd instead.
From Scheduling Timed Jobs (official Apple docs):
Note: Although it is still supported, cron is not a recommended solution. It has been deprecated in favor of launchd.
You can find additional information (such as the launchd Wikipedia page) with a simple web search.
Try this:
0,30 * * * * your command goes here
According to the official Mac OS X crontab(5) manpage, the /
syntax is supported. Thus, to figure out why it wasn't working for you, you'll need to look at the logs for cron. In those logs, you should find a clear failure message.
Note: Mac OS X appears to use Vixie Cron, the same as Linux and the BSDs.
crontab does not understand "intervals", it only understands "schedule"
valid hours: 0-23 -- valid minutes: 0-59
example #1
30 * * * * your_command
this means "run when the minute of each hour is 30" (would run at: 1:30, 2:30, 3:30, etc)
example #2
*/30 * * * * your_command
this means "run when the minute of each hour is evenly divisible by 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)
example #3
0,30 * * * * your_command
this means "run when the minute of each hour is 0 or 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)
it's another way to accomplish the same results as example #2
example #4
19 * * * * your_command
this means "run when the minute of each hour is 19" (would run at: 1:19, 2:19, 3:19, etc)
example #5
*/19 * * * * your_command
this means "run when the minute of each hour is evenly divisible by 19" (would run at: 1:19, 1:38, 1:57, 2:00, 2:19, 2:38, 2:57, 3:00 etc)
note: several refinements have been made to this post by various users including the author
Do:
0,30 * * * * your_command