How to fix “Bad minute” error while installing a new crontab

Each crontab line must start with a time at which the command should be run and then the command. The general format is:

Min Hour Day Month DayOfWeek Command

So, to run command at 10:15 every Sunday, you'd do:

15 10 * * 0 command

I'm not sure what your commands are, but you have lines that don't start with a time definition. I don't understand what lines like this are:

* * * * * /usr/local/ampps/php-5.6/etc

That's a time but no command. You're giving it a directory. And lines like this have commands but no time:

/usr/local/ampps/www/localshop.dev/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /usr/local/ampps/www/localshop.dev/var/log/magento.cron.log

So, make sure you follow the format and you should be fine. If this is not clear, edit your question and explain what commands you are trying to run.


From my previous experience, it was due to a CR/LF character before the first cron line (since it was edited from Windows not Linux directly). I noticed and removed that char from a HEX editor.


This error also happens if your /var/spool/cron partition is 100% full. Check your free disk space and make sure you have a few bytes free there.

Tags:

Cron