Bad minute crontab error

This is a common error

Context

To understand this error, it's useful to know two rules about crontab files:

  1. Every line in your crontab must conform with the cron specification. Other than blank lines and environment variables, every line must be a comment (beginning with #) or begin with a valid cron job schedule expression.
  2. The first part of a cron job schedule expression is the minute field.

What causes this error

When cron reads each line of your crontab, if the line is not a comment it expects it to start with a valid minute expression. If for some reason it doesn't, it will raise a Bad Minute error.


Fixing bad minute errors

This type of error could have many causes. Here are some troubleshooting steps to identify and fix the problem.

  1. The error message will commonly indicate the line number that is problematic. Look for the number after a colon, in this example it's line 11.
    "/tmp/crontab.gLfS38":11: bad minute
  2. Check for unexpected line breaks in your crontab file. Sometimes you may inadvertently wrap a long line by adding a line break. Cron requires the full schedule and command on a single line.

    Good:

    0 0 * * * /very/long/example/command/goes/here "with several very long arguments"
    Bad:
    0 0 * * *
    /very/long/example/command/goes/here "with several very long arguments"

  3. If every line begins with a cron schedule, check that the first field is accurate. Here are the allowed values for the minute field:
    Value Description
    0-59 Specific Minute
    * Every Minute
    , List of Minutes, e.g. 1,3,5
    - Range of Minutes, e.g 1-10
    / Minute step value, e.g. 1/5

    Tip:To verify and validate your cron expression use Crontab Guru, the free and simple cron expression editor from Cronitor.

  4. Review any comments in your crontab file and ensure that they all start with a #.
  5. If you have verified that your cron expression is correct and you have examined each line for spurious characters or extra line breaks, it's possible you are dealing with a non-standard version of Cron. Review your local documentation for further guidance on crontab format. You can do this from your command line by running man 5 crontab

Our software, CronitorCLI, includes the free tools we always wished we had.  Scan your system and list every cron job in seconds using cronitor list.  Run any cron job instantly using cronitor select.