crontab
.
guru

The quick and simple editor for cron schedule expressions.
By WDT.io - the reliable monitor for your cronjobs.

Tips for writing crontab expressions:

Tip 1: If the day-of-month or day-of-week part starts with a *, they form an intersection. Otherwise they form a union. * * 3 * 1 runs on the 3rd day of the month and on Wednesday (union), whereas * * */2 * 1 runs on every second day of the month only if it's also a Monday (intersection). The manpage is incorrect about this detail. More info.

Tip 2: Cron jobs can break. Don't rely just on email to find out because the root cause can be outside of cron. Monitor each cronjob with a watchdog timer.

Tip 3: Run your servers including the cron process in UTC timezone. Why?

Tip 4: Some cron implementations allow to specify years and seconds. However, cron is not the best tool if you need to operate at those levels, which is also why crontab.guru doesn't support them.

Tip 5: Don't use @reboot because it has too many issues.

Tip 6: More difficult schedules can be realized by combining multiple cron expressions. For example, if you need to run X every 90 minutes, create one crontab entry that runs X every 3 hours on the hour (0 */3 * * *), and a second crontab entry that runs X every 3 hours with an offset (30 1/3 * * *).

Tip 7: Another alternative for complicated schedules is Mcron.

More tips: Best practices for cron