The cron expression for every 7 days is 0 0 */7 * *. Here is what each field means, when the job runs next, and how to know if it stops running.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 0 | At hour 0 |
| Day of month | */7 | Every 7 days: 1, 8, 15, 22 and 29 |
| Month | * | Every month |
| Day of week | * | Every day of the week |
*/7 in the day-of-month field means the 1st, 8th, 15th, 22nd and 29th, and it restarts every month, so the last run of a month can be 2 or 3 days before the next. For a run every 7 days exactly, schedule it on a weekday: 0 0 * * 0 runs every Sunday.
Cron doesn't tell you when a job is skipped, crashes or hangs. Create a Hyperping healthcheck in cron mode with 0 0 */7 * * and the job's timezone, add one curl to the end of the job, and you're alerted when a run is missed. Free for up to 20 jobs.
Popular cron schedules:
Every minute • Every 5 minutes • Every 10 minutes • Every 15 minutes • Every 30 minutes • Every hour • Every 2 hours • Every 3 hours • Every 4 hours • Every 6 hours • Every 8 hours • Every 12 hours • Every 24 hours
Every day • Every 2 days • Every 7 days • Every week • Every weekday • Every weekend • At midnight • At noon
Start of month • Twice a month • Every quarter • Every 6 months • Every year • Every leap year
During office hours • Overnight • Every spring • Every fall • Every winter • On Christmas • On New Year
Every 2 minutes • Every 3 minutes • Every 5 hours • Every 16 hours
Related: Cron job monitoring, get alerted when a job misses its schedule