0

I recently installed a new Magento 2.2.6 website on a VPS server. Everything seemed to install correctly. The issue I have now is the logs in the var folder are not being populated (update.cron.log, setup.cron.log, magento.cron.log) and the MySQL Database cron_schedule has almost all of the scheduled tasks marked as missed. These are the settings in Magento admin under store>configuration>advanced>system>cron:

Schedule:15 Schedule ahead:20 missed: 45 history 10 success lifetime: 60 failure Lifetime: 600 Use separate process: No

I had an old Magento 2.1 site on a shared host which I had to cancel due to lack of SSL Renewal. The Cron Jobs all worked properly the cron_schedule table populated with all success and the log files are populated. I can not figure out what is wrong. The file and folder permissions are correct as far as I know (var folder 777, var/log 777, all cron.log files 644) Please help this is driving me crazy.

3
  • Please check in cmd that is it available if yes then we can go further with that otherwise it might be permission issue. Oct 2, 2018 at 5:08
  • select job_code from cron_schedule GROUP BY job_code; Oct 2, 2018 at 5:09
  • I ran this command [grep "cronscript.php" /var/log/cron] and received access denied. I think maybe it is a permission issue. After talking to my host provider they say cron is running and set me a log for the 3 cron jobs. Is it possible that the jobs are running but due to permissions the cron_schedule table is not updated to reflect success and the logs are not being populated?
    – Rich K.
    Oct 2, 2018 at 14:38

1 Answer 1

1

As you mentioned you have setup Magento in new VPS server.

so maybe you missed to set up cron in crontab please check crontab -l from root directory via ssh.

Did you see cron setup there? if not then please use crontab -e to setup cron in crontab and paste below code there.

#~ MAGENTO START
* * * * * /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
#~ MAGENTO END

for more details follow below link

https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html

I think you should install free magento2 extension to check your cron status if not installed where you can track your cron

https://www.wyomind.com/cron-scheduler-magento.html

1
  • I ran crontab -l and all 3 cron jobs are listed. As I commented in the previous commentor above I spoke to my host provider and they say the logs show the cron jobs are running. Could it be a permission issue preventing the system from updating the cron_schedule to success and the var/log files from being populated?
    – Rich K.
    Oct 2, 2018 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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