From ac6c14296211802a99932f8bd0006b3f33107e33 Mon Sep 17 00:00:00 2001 From: David Lesieur Date: Mon, 2 Sep 2024 18:54:43 -0400 Subject: [PATCH] Use nice in the cron job. --- docs/deploying.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/deploying.md b/docs/deploying.md index 52cf250..f1cc494 100644 --- a/docs/deploying.md +++ b/docs/deploying.md @@ -125,23 +125,25 @@ its servers from getting overloaded, so sometimes the process might seem to freeze, but be patient and Kerko will resume synchronization a few minutes later. -Now that synchronization works, configure the cron task that will synchronize -data from your Zotero library on a regular basis. Run the following command -(always from the `kerkoapp` user): +Now that synchronization works, configure a cron task that will periodically +synchronize data from your Zotero library. Run the following command (again from +the `kerkoapp` user): ```bash crontab -e ``` -That will launch the default `nano` editor. Add the following line at the very -bottom, then save the file and exit the editor: +That will launch the default text editor. Add the following line at the end of +the file, then save the file and exit the editor: ``` title="crontab" -10 4 * * * cd /home/kerkoapp/kerkoapp && /home/kerkoapp/venv/bin/flask kerko sync +10 4 * * * cd /home/kerkoapp/kerkoapp && nice -n 10 /home/kerkoapp/venv/bin/flask kerko sync ``` -That will synchronize the data once a day, at 4:10am. You may specify a -different time, of course. +That line instructs cron to run the `sync` command once a day, at 4:10am. You +may specify a different time, of course. The `nice` command will cause the +synchronization process to gently relinquish its priority to other processes, +should the server be busy at that time. Now exit from the `kerkoapp` user's shell, and go back to your usual sudoer account to finish the installation.