googlemagento

Configure scheduled tasks

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Magento cron tasks are enabled for cloud images by default.

Approach A: Bitnami installations using system packages

Check if they are working by running this command:

$ sudo cat /etc/cron.d/magento

The output should contain this line if they are enabled:

*/1 * * * * daemon /opt/bitnami/php/bin/php /opt/bitnami/magento/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /opt/bitnami/magento/var/log/magento.cron.log

If you wish to disable them, just follow the steps below:

  • Edit the /etc/cron.d/magento file:

      $ sudo nano /etc/cron.d/magento
    
  • Comment the following line:

      #*/1 * * * * daemon /opt/bitnami/php/bin/php /opt/bitnami/magento/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /opt/bitnami/magento/var/log/magento.cron.log
    
  • Save the file and exit.

Approach B: Bitnami installations using system packages

Check if they are working by running this command:

$ sudo cat /etc/crontab

The output should contain these lines if they are enabled:

* * * * * /opt/bitnami/apps/magento/htdocs/bin/magento-cli cron:run -vvv 2>&1 >> /opt/bitnami/apps/magento/htdocs/var/log/magento-cron.log #magento-cron
* * * * * /opt/bitnami/php/bin/php /opt/bitnami/apps/magento/htdocs/update/cron.php 2>&1 >> /opt/bitnami/apps/magento/htdocs/var/log/magento-update-cron.log #magento-update-cron
* * * * * /opt/bitnami/apps/magento/htdocs/bin/magento-cli setup:cron:run -vvv 2>&1 >> /opt/bitnami/apps/magento/htdocs/var/log/magento-setup-cron.log #magento-setup-cron

If you wish to disable them, just follow the steps below:

  • Edit the /etc/crontab file:

      $ sudo crontab -e
    
  • Comment the following lines:

      #* * * * * /opt/bitnami/apps/magento/htdocs/bin/magento-cli cron:run
      #* * * * * /opt/bitnami/php/bin/php /opt/bitnami/apps/magento/htdocs/update/cron.php
      #* * * * * /opt/bitnami/apps/magento/htdocs/bin/magento-cli setup:cron:run
    
  • Save the file and exit.

Last modification January 22, 2021