'Cron - bad minute errors in crontab file, can't install
So I have a cron
file sms.cron
that I want to execute every 15 minutes that looks like that:
15 * * * * docker-compose exec php bin/console app:send-sms
I do not precise the path to the command cause the command is at root and the sms.cron
as well
I try to run it manualy with command :
crontab sms.cron
And get the following error:
"sms.cron":1: bad minute
errors in crontab file, can't install
I get that I have a syntax error but looked at several similar issue on internet and do not see where this error might come from.
Does anyone have any idea on where this syntax error might come from ? Thanks!
UPDATE
Also tried this syntax:
*/15 * * * * docker-compose exec php bin/console app:send-sms
which returned the following error message :
"sms.cron":0: bad minute
errors in crontab file, can't install.
Output of od -c sms.cron
:
0000000 ` ` ` \n * / 1 5 * * * *
0000020 d o c k e r - c o m p o s e
0000040 e x e c p h p b i n / c o n
0000060 s o l e a p p : s e n d - s m
0000100 s \n ` ` `
0000105
UPDATE
The issue came from those char: ```
that were present in my cron file
before and after my command


Solution 1:[1]
I had a similar problem with a file I ported from windows. Did not work until I changed \r\n
into \n
.
Found it only because of this error message here. Thanks to all!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Tyler2P |