0

Recently i had moved my website from Bluehost to AWS.

Now i have to create cronjobs for magento in AWS (Ubuntu OS). please help me how to setup the cronjobs in Linux and if possible please share me the guide.

2
  • you have cpanel? Jun 2, 2021 at 3:44
  • NO i dont have cpanel @Gohil Rajesh Jun 2, 2021 at 4:05

2 Answers 2

0

go to AWS Console
select your instance
select connect from menu
choose your connection
after connection:

cd to magento webroot, and run as magento files owner bin/magento cron:install

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

0

You have to have SSH access to your Magento 2 installation in order to run it as smooth as it should. Make sure, you get the access.

As soon as you have access to your instance, go to the Magento 2 root directory and run php bin/magento cron:install then put below 3 command

* * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log
* * * * * <path to php binary> <magento install dir>/update/cron.php >> <magento install dir>/var/log/update.cron.log
* * * * * <path to php binary> <magento install dir>/bin/magento setup:cron:run >> <magento install dir>/var/log/setup.cron.log

if you are on magento 2.4 then run only below single command other is deprecated

* * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log

Depending in the admin panel, you might have to enter the path to the PHP binary. If you are not sure which path it is, just try php.

in last run "crontal -l" for check your cron setuped or not

hope this helps you :)

6
  • you tried this? Jun 2, 2021 at 9:37
  • for magento 2.4 it needs only one cron command bin/magento cron:run
    – MagenX
    Jun 2, 2021 at 12:28
  • @magenx it will run only once..they need like every 5 min Jun 2, 2021 at 12:41
  • im saying from your list only first command required. others deprecated `
    – MagenX
    Jun 2, 2021 at 12:46
  • exactly you are right. But they not clarified version.so, I posted all. Jun 2, 2021 at 14:24

Your Answer

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

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