Close [x]

Set up cron for Component Manager and System Upgrade

Edit this page on GitHub

Set up cron jobs

To enable the updater to work for both the Component Manager and System Upgrade, you must configure two cron jobs. Each cron job should run every minute.

Enable the cron jobs as crontabs for the Magento file system owner because that user runs the updater application for the Component Manager and System Upgrade.

  1. As a user with root privileges, see if a crontab is already set up.

    crontab -u <Magento file system owner user name> -l
    

    For example, on CentOS

    crontab -u magento_user -l
    

    If no crontab has been set up for the user, the following message displays:

    no crontab for magento_user
    
  2. If necessary, set up the crontabs as follows as a user with root privileges:

    crontab -u <Magento file system owner user name> -e
    

    An editor displays. In the editor, enter the following:

    */1 * * * * <path-to-binary> -c <ini-file-path> <your Magento install dir>/update/cron.php 
    */1 * * * * <path-to-binary> -c <ini-file-path> <your Magento install dir>/bin/magento setup:cron:run 
    

    where

    • <path-to-binary> is the absolute file system path to your PHP binary (use which php to find it)
    • <ini-file-path> is the path to a php.ini file to use for the cron job; generally, you should use the web server plug-in鈥檚 php.ini file. To find it, create a phpinfo.php file.

    For example,

    */1 * * * * /usr/bin/php -c /etc/php5/apache2/php.ini /var/www/magento2/update/cron.php 
    */1 * * * * /usr/bin/php -c /etc/php5/apache2/php.ini /var/www/magento2/bin/magento setup:cron:run 
    
  3. Save your changes to cron and exit the editor.

Next step