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.
ownCloud allows three methods for executing background jobs, as described in the ownCloud manual. Depending on your installation type, different modes are configured to run scheduled tasks.
Approach A: Bitnami installations using system packages
By default, the cron mode is configured to run scheduled tasks. If you want to change this, remove the /etc/cron.d/owncloud cron file:
$ sudo rm /etc/cron.d/owncloud
If you removed the file and want to enable cron mode again, run the following command:
$ echo "*/1 * * * * daemon /opt/bitnami/php/bin/php /opt/bitnami/occ system:cron" | sudo tee /etc/cron.d/owncloud
Approach B: Self-contained Bitnami installations
By default, the AJAX mode is configured to run scheduled tasks.
If you prefer to use cron, edit the crontab by running the following command
$ sudo crontab -e
Add the following line at the end of the file:
*/1 * * * * su daemon -s /bin/sh -c "/opt/bitnami/php/bin/php /opt/bitnami/apps/owncloud/htdocs/occ system:cron > /dev/null 2>&1"