Home  »  CodeSnippetsTechnologyTools   »   How to Run cron job Every 12 Hours (Twice a day)

How to Run cron job Every 12 Hours (Twice a day)

Posted: September 11, 2022 | by Michael Bright

This example cron job snippet runs at 12am (00:00:00) and 12pm (12:00:00) daily:

0    */12   *    *    *      your_script.sh

The */12 portion executes cron exactly at 12am and 12pm.

What about a custom time like 6am and 11pm? Set hours like 06,23 (24 hours). Example here:

0    06,23   *    *    *      your_script.sh

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.