Software⏱️ 4 min read📅 2026-06-15

How to Fix: Debian 9 upgrade cron Error: bad minute;

Debian cron error fix for bad minute; issue.

Quick Answer: The crontab file /etc/cron.d/sync has an invalid minute value (-5), which is causing the error. Remove or modify the line to correct the issue.

Debian users who have recently upgraded to version 9.4 from a previous version may encounter an error with their cron system. The error message 'bad minute;' while reading /etc/cron.d/sync' indicates that there is a problem with the crontab file located at this path. This error can be frustrating because it prevents the sync and fstrim processes from running as intended, which can lead to issues with disk space management.

The issue of cron error 'bad minute;' while reading /etc/cron.d/sync' may seem like a minor problem but it can have significant consequences on system performance and overall stability. In this guide, we will walk you through the steps to identify and resolve this issue.

🔍 Why This Happens

  • The first main reason why this error happens is due to an invalid crontab file. The crontab file located at /etc/cron.d/sync contains a line with an invalid minute specification, which causes the cron system to fail. This can happen if the user accidentally adds or modifies a line in the crontab file without proper understanding of the syntax.
  • Another alternative reason for this error is that the UID of the owner of the crontab file is not set correctly. If the UID is 0 (root), the first character of a crontab entry can be '-' which prevents cron from writing a syslog message about the command being executed. However, in this case, the UID is not specified, and the '-' character may still cause issues.

🔧 Proven Troubleshooting Steps

Correcting the invalid crontab file

  1. Step 1: First, we need to identify the line in the /etc/cron.d/sync crontab file that contains the invalid minute specification. We can do this by running the command `cat -v /etc/cron.d/sync` and looking for any unusual characters or syntax.
  2. Step 2: Once we have identified the problematic line, we need to correct it. The line in question is likely to be: `-5 23 * * * root fstrim /`. To fix this, we can simply remove the '-' character from the beginning of the line. This will allow cron to process the crontab file correctly.
  3. Step 3: After making the necessary changes, we need to reload the cron system to apply our modifications. We can do this by running the command `service cron reload` or `systemctl reload cron` depending on the system configuration.

Correcting the UID of the owner

  1. Step 1: If we suspect that the issue is due to an incorrect UID, we can try setting the UID explicitly. We can do this by running the command `chown root:root /etc/cron.d/sync` to set the ownership of the crontab file.
  2. Step 2: After setting the correct ownership, we need to reload the cron system to apply our changes. Again, we can run the command `service cron reload` or `systemctl reload cron` depending on the system configuration.

🎯 Final Words

To summarize, the error 'bad minute;' while reading /etc/cron.d/sync' is typically caused by an invalid crontab file or incorrect UID of the owner. By following the steps outlined in this guide, you should be able to identify and correct the issue, allowing your cron system to function correctly and ensuring that your sync and fstrim processes run as intended.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions