Jump to content

Nextcloud Cron job


brent

Recommended Posts

Cron
Using the operating system cron feature is the preferred method for executing regular tasks. This method enables the execution of scheduled jobs without the inherent limitations the Web server might have.

To run a cron job on a *nix system, every 5 minutes, under the default Web server user (often, www-data or wwwrun), you must set up the following cron job to call the cron.php script:

sudo crontab -e -u www-data
 */5  *  *  *  * php -f /var/www/cloud.kc-linux.com/html/cron.php
 */5 * * * * /usr/bin/php /var/www/cloud.kc-linux.com/html/occ preview:pre-generate > /dev/null 2>&1

You can verify if the cron job has been added and scheduled by executing:

crontab -u www-data -l

 

If Cron isn't working and you are getting an error under nextcloud basic setting about site not running back ground processes. 

go to  /etc/php/{{ php_version }}/mods-available/apcu.ini and add the below.

apc.enable_cli=1 

Once added run:

sudo -u www-data php -f /var/www/nexcloud/cron.php

If it completes without errors it's working.

 

 

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...