Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
Created March 27, 2015 07:12
Show Gist options
  • Save v-thomp4/cf4e893b559c7ce7b599 to your computer and use it in GitHub Desktop.
Save v-thomp4/cf4e893b559c7ce7b599 to your computer and use it in GitHub Desktop.
Run a cron job every minute only on specific hours
*/1 11,16,21 * * * COMMAND

Traditional (inherited from Unix) cron format consists of five fields separated by white spaces:

*    *    *    *    *  command to be executed
┬    ┬    ┬    ┬    ┬
│    │    │    │    │
│    │    │    │    │
│    │    │    │    └───── day of week (0 - 6) (0 is Sunday, or use names)
│    │    │    └────────── month (1 - 12)
│    │    └─────────────── day of month (1 - 31)
│    └──────────────────── hour (0 - 23)
└───────────────────────── min (0 - 59)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment