Read More
Read More
Menu Close

    How To Setup CRON For Magento 2

     

    In this post we will learn to setup cron on server for Magento 2  crons. In Magento 2 their are many configurations which needs cron for proper working of your magento.

    Some of the tasks which are handled by cron in Magento 2 are:

    • Catalog price rules
    • Newsletters
    • Generating Google Sitemaps
    • Customer Alerts/Notifications
    • Reindexing
    • Automatic updating of currency rates

    Now we will going to setup cron on the server.

    Run the following command from the terminal

    Searching for an experienced
    Magento 2 Company ?
    Read More
    crontab -e

    If you are logged in as root user you can specify the cronjob for the Magento file system owner only by specifying the username by using the -u switch.

    crontab -u <magento file system user> -e
    

    When you hit the above command, editor option will appear select anyone in which you are comfortable with. In the editor enter the following cronjob.

    * * * * * <path to php binary> <magento install dir>/bin/magento cron:run

    In my case I have used the following command.

    * * * * * php /home/ayaz/www/html/mage2/bin/magento cron:run
    

    We are done on the setup for server. Please note that the cronjob I setup is running every minute. You can schedule it as per your need. You can check the cron has setup correctly by viewing the cron_schedule table in your magento database. You will see entries like this:

    cron_schedule_image

    You can learn more on cron in this post: http://webkul.com/blog/magento2-setup-cron-config-path/

    That’s all for cron setup on server for magento, you can query or give feedback in the comments below, it will help us in improving. Hope this post will help you. Thanks 🙂

    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top