2

Magento ver. 1.9.3.8

In my Cpanel I have 2 cron jobs set to run */5 * * * *.

/usr/local/bin/ea-php56 /home/myusername/public_html/cron.php -mdefault >/home/myusername/public_html/var/log/myjob1.log

/usr/local/bin/ea-php56 /home/myusername/public_html/cron.php -malways >/home/myusername/public_html/var/log/myjob.log

If I just create the cron jobs in Cpanel nothing happen. I then have to run the same commands using SSH. Only then do they start.

For some reason, my cron jobs turn off around 00:00 but not every night. Sometimes it goes 2-3 days working. Once it turns off, it turns off around the same time and I have to repeat the SSH steps.

The first time I noticed it was 1.9.3.7. Since then I have been trying to trouble shoot.

Any help with this would be greatly appreciated.

enter image description here

1

I'd avoid using cPanel for your crons, since you have SSH access to your server (As you're running the commands manually) then you can add them directly to the cron running on the server. Using crontab -e you can create new cronjobs on the server and you can add your crons there. Make sure you're sudo'd to the web user when adding a new crontab so that they run as the correct user.

*/5 * * * * /usr/local/bin/ea-php56 /home/myuser/public_html/cron.php -mdefault >/home/patch/public_html/var/log/myjob1.log

*/5 * * * * /usr/local/bin/ea-php56 /home/myuser/public_html/cron.php -malways >/home/patch/public_html/var/log/myjob.log

Further suggestions

I can see you're using cron.php but you have AoE Scheduler installed, so you should use scheduler_cron.sh through /bin/bash instead. Example:

*/5 * * * * /bin/bash /home/myuser/public_html/scheduler_cron.sh -mdefault >/home/patch/public_html/var/log/myjob1.log

Build in a test flag to ensure crons don't run when a maintenance.flag is up (Your site is in maintenance mode). Example:

*/5 * * * * ! test -e /home/myuser/public_html/maintenance.flag && /bin/bash /home/myuser/public_html/scheduler_cron.sh -mdefault >/home/patch/public_html/var/log/myjob1.log

Hope that helps!

| improve this answer | |
  • No problem! Did this help solve your issue? – Matt Antley May 11 '18 at 8:21

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.