3

I moved Magento 2.2.7 from one host to another. I moved it myself. Everything worked except the cron. I installed cron using magento cron command.

Now every 15 min. cron is running and sending me a mail. Below is the mail subject and mail content. Is this correct or something is wrong with the cron.

Email Subject:

Cron <rbhomroh@cs-mum-1> /opt/alt/php71/usr/bin/php /home/rbhomroh/public_html/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /home/rbhomroh/public_html/var/log/magento.cron.log* * * * * /opt/alt/php71/usr/bin/php /home/rbhomroh/public_html/update/cron.php >> /home/rbhomroh/public_html/var/log/update.cron.log* * * * * /opt/alt/php71/usr/bin/php /home/rbhomroh/public_html/bin/magento setup:cron:run >> /home/rbhomroh/public_html/var/log/setup.cron.log#~ MAGENTO END 20c7f3f92a734843b2f4781ef0ebc235

Email body content:

grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: setup:cron:run: No such file or directory
grep: MAGENTO: No such file or directory
grep: END: No such file or directory
grep: 20c7f3f92a734843b2f4781ef0ebc235: No such file or directory

When I installed the cron using ssh command, these were 3 different crons. but now all merged to single one.

Email Screen shot Please suggest if this is correct or some issue with the cron.

Regards, Niraj

1

As per image, It need many correction:

  1. Remove form last line: #~ MAGENTO END 20c7f3f92a734843b2f4781ef0ebc235

  2. You need to setup three separate CRON Job for same time interval like:

    /usr/bin/php /var/www/html/magento2/bin/magento cron:run | grep -v Ran jobs by schedule >> /var/www/html/magento2/var/log/magento.cron.log
    
    /usr/bin/php /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log
    
    /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log 
    

    Note You need to change PHP path and Magento Root directory

Hope above will Help!

  • @Hello Pawan removed cron and reinstalled and edited as per the suggestion. Till now no error email. – Niraj Nagar Mar 18 at 6:52
  • following life is repeating - /bin/bash: /user/bin/php: No such file or directory - - in side magento.cron.log file – Niraj Nagar Mar 18 at 7:41
  • Did my solution worked ? – Pawan Mar 18 at 11:58
  • 1
    you php path is not correct – Pawan Mar 19 at 17:18
  • 1
    please check and confirm php path and replace with /usr/bin/php. you can check it by which php. – Pawan Mar 19 at 17:20

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.