From 82cddfa8f352395040ee814fbdf6d9a7a1c9108a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Wed, 13 Sep 2017 17:16:14 +0200 Subject: [PATCH] Add static file genration, and two maintenance tasks --- conf/cron_weblate | 10 ++++++++-- scripts/backup | 2 -- scripts/install | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/conf/cron_weblate b/conf/cron_weblate index 6b5febf..198016e 100644 --- a/conf/cron_weblate +++ b/conf/cron_weblate @@ -1,3 +1,9 @@ -# https://docs.weblate.org/en/latest/admin/management.html#update-index -# every 10 minutes +# https://docs.weblate.org/en/latest/admin/install.html#production-cron +# Fulltext index updates 10 * * * * www-data cd "__FINALPATH__" && python3 ./manage.py update_index + +# Cleanup stale objects +@daily cd "__FINALPATH__" && ./manage.py cleanuptrans + +# Commit pending changes after 96 hours +@hourly cd "__FINALPATH__" && ./manage.py commit_pending --all --age=96 --verbosity=0 diff --git a/scripts/backup b/scripts/backup index 2c52551..efca4fa 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -# TODO: https://docs.weblate.org/en/latest/admin/install.html#migrating-database - #================================================= # GENERIC START #================================================= diff --git a/scripts/install b/scripts/install index 6333d2e..6f23e7f 100755 --- a/scripts/install +++ b/scripts/install @@ -159,7 +159,10 @@ ynh_replace_string "__KEY__" "$key" $final_path/weblate/settings.py # https://docs.weblate.org/en/latest/admin/install.html#filling-up-the-database #========================================== +# set up database sudo $final_path/manage.py migrate --noinput +# generate static files +sudo $final_path/manage.py collectstatic --noinput #================================================= # SETUP CRON