Skip to content

Commit

Permalink
[nextcloud] add random sleep to cronjob in guide_nextcloud.rst close #…
Browse files Browse the repository at this point in the history
…1318 (#1320)

* add random sleep to cronjob in guide_nextcloud.rst

add `sleep $(( 1 + $RANDOM \% 60 )) ;` to cronjob in line 252

* explain the random sleep in guide_netcloud.rst 

Add a note to explain why actual cronjob is preceded by a random sleep.
  • Loading branch information
kimdiallo authored Sep 15, 2022
1 parent 8f306fe commit 64c94fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/guide_nextcloud.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ Add the following cronjob to your :manual:`crontab <daemons-cron>`:

::

*/5 * * * * php -f $HOME/html/cron.php > $HOME/logs/nextcloud-cron.log 2>&1
*/5 * * * * sleep $(( 1 + $RANDOM \% 60 )) ; php -f $HOME/html/cron.php > $HOME/logs/nextcloud-cron.log 2>&1

.. note:: The actual cronjob is preceded by a random sleep of maximum one minute to prevent load peaks every 5 minutes due to simultaneous execution of all cronjobs.

Configure Nextcloud to rely on the configured cronjob:

Expand Down

0 comments on commit 64c94fe

Please sign in to comment.