0

I add the

30 22 * * * php /www/wwwroot/easy_xyz/xcat sendDiaryMail

line in my crontab -e to like this:

30 22 * * * php /www/wwwroot/easy_xyz/xcat sendDiaryMail
55 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null

but get error:

crontab: installing new crontab
"/tmp/crontab.d7MGaW":1: bad minute
errors in crontab file, can't install.
Do you want to retry the same edit?

where is the issue, I did not find it.

  • Maybe you write wrong character at the benning of line, open crontab again and check (this can happen if you copy and paste ) – Skamasle Dec 9 '18 at 17:13
  • there is no wrong character. – 26334_zeal Dec 9 '18 at 17:21
  • 1
    Try removing the line and write it by your hand at the end of file and not copy / paste, you may see it more clear. – Skamasle Dec 9 '18 at 17:32
  • 1
    Avoid copy and pasting from web pages – Rui F Ribeiro Dec 9 '18 at 17:40
  • Even copied & pasted out of your post the line gets happily used on my box? – tink Dec 9 '18 at 18:15
-1

Try the following:

30 20 * * * /usr/bin/php /www/wwwroot/easy_xyz/xcat sendDiaryMail
  • this works, why? – 26334_zeal Dec 10 '18 at 3:02
  • Because the user running the cron job needs to have /usr/bin/php in their path. – cherrysoft Dec 10 '18 at 15:38
  • the php have the path environment there, I think this is because of the other format, because I copy from the Mac text editor. – 26334_zeal Dec 11 '18 at 2:32
0

Make very sure the crontab file is terminated with a char.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.