Syntax for the crontab

While the syntax may initially seem confusing, it is actually not that hard to understand but extremely flexible:

<timestamp> command

Wow, that was easy! If this were really the case, then yes. However, what we described above as <timestamp> is actually composed of five different fields, which make up the combined period for running jobs multiple times. In reality, the timestamp is defined as follows (in order):

  1. Minute-of-the-hour
  2. Hour-of-the-day
  3. Day-of-the-month
  4. Month
  5. Day-of-the-week

In any of these values, we can substitute a number for a wildcard, which indicates all values. Look at the following table to get a feeling about how we combine these five fields for precise times:

 Crontab     syntax

 Semantic ...

Get Learn Linux Shell Scripting - Fundamentals of Bash 4.4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.