Linux – Crontab command not executed

centoscentos7cronlinux

Coming from Why is my crontab not working, and how can I troubleshoot it? i still don`t know why my command is not executed.

I got same command for root and www-data

enter image description here

and my cron logs shows that cron is executed every minute

enter image description here

however, i never got /tmp/crontest.log file. I notice this problem because i wanted to make wordpress external cron (executing php file).

Of course, executing that command from command line is working.

Any tips?

Best Answer

Your crontab file has the wrong lineendings - it's got carriage return (CR)/linefeed (LF) endings. You can see this in your first screenshot, where there's a [dos] after the filename. Unix systems expect lines to be terminated by linefeeds only, whereas Windows systems use a carriage return/linefeed pair.

There are a few ways to correct this. As you seem to be familiar with vi, I'd suggest this to replace the CR/LFs with LFs. Just edit your crontab and then do the search and replace.