0

I have gone through many pages regarding setting up cron correctly, whilst magento passed the readiness check on an extension install for cron, it still does not seem to run unless i run this command: bin/magento cron:run. I know this because if i empty 'cron_schedule' table and wait, nothing will show but then running that command will bring up the list of cronjobs expected, leaving me to repeat the same.

Here are the lines that are written into crontab:

*/1 * * * * /usr/local/bin/php -c /opt/cpanel/ea-php70/root/etc/php.ini 
/home/admin/public_html/bin/magento cron:run | grep -v "Ran jobs by 
schedule" >> /home/admin/public_html/mag/var/log/magento.cron.log

*/1 * * * * /usr/local/bin/php -c /opt/cpanel/ea-php70/root/etc/php.ini 
/home/admin/public_html/mag/update/cron.php >> 
/home/admin/public_html/mag/var/log/update.cron.log

*/1 * * * * /usr/local/bin/php -c /opt/cpanel/ea-php70/root/etc/php.ini 
/home/admin/public_html/mag/bin/magento setup:cron:run >> 
/home/admin/public_html/mag/var/log/setup.cron.log

It's showing the same in cPanel.

Do i need to use the command crontab -u magento user -e where my magento user is modxpc or do i need to use admin which is the cPanel username which is the user which has ownership to the directories. Both allow me to edit the lines but the changes in cPanel show up using 'admin'.

To add to the problem - i have noticed that every time i want to install an extension it'll throw an internal 500 error which i found keeps happening because the rights and owner gets reset to 0 every time, so i need to apply find ./var -type d -exec chmod 777 {} \; to get the back end running again. Why are the permissions being changed?

0

It looks like your service is with GoDaddy? In any case, I think you have extra commands that may not be necessary to run the cron. Also check the path to your /var/log folder. You have "admin" but it should be replaced by your site/account name.

try the following:

/usr/local/bin/php /home/yoursite/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/yoursite/public_html/var/log/magento.cron.log

/usr/local/bin/php /home/yoursite/public_html/update/cron.php >> /home/yoursite/public_html/var/log/update.cron.log

/usr/local/bin/php /home/yoursite/public_html/bin/magento setup:cron:run >> /home/yoursite/public_html/var/log/setup.cron.log

I would also change "1" for minutes to "*" as it would be the same thing.

Let me know how this works out.

0

Please check this link http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html here is guide how to set cron and get php path.

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.