Configure scheduled tasks
NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.
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 installdir/orocrm && installdir/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/ * * * * installdir/php/bin/php installdir/apps/orocrm/htdocs/bin/console oro:cron --env prod >> /dev/null
-
Save the file.