generalorocrm

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.

Cron jobs allow OroCRM to execute tasks that should be executed at fixed times (for example, sending email to customers or generating reports). Usually, these tasks wouldn’t be performed by visiting a particular URL using your browser. Instead, you’ll configure your operating system to execute some script which performs the desired tasks.

Approach A: Bitnami installations using system packages

Cron jobs are enabled by default. To edit them, follow these steps:

  • Run the following command to edit the crontab file:

      $ sudo nano /etc/cron.d/orocrm
    
  • Add the following lines to the file. The jobs will be executed at the first minute of every hour. You can modify the timing if you wish:

      */1 * * * * daemon cd /opt/bitnami/orocrm && /opt/bitnami/php/bin/php bin/console oro:cron --env=prod >> /dev/null 2>&1
    
  • Save the file.

Approach B: Self-contained Bitnami installations

Follow these steps:

  • Run the following command to edit the crontab file:

      $ sudo crontab -e
    
  • Add the following lines to the file. The jobs will be executed at the first minute of every hour. You can modify the timing if you wish:

      *1/ * * * * /opt/bitnami/php/bin/php /opt/bitnami/apps/orocrm/htdocs/bin/console oro:cron --env prod >> /dev/null
    
  • Save the file.

Last modification March 9, 2021