1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

Improve cron file

This commit is contained in:
Jean-Baptiste Holcroft 2018-06-13 23:49:24 +02:00
parent d942065f6a
commit 5e78b6e62e
3 changed files with 11 additions and 3 deletions

View file

@ -1,9 +1,9 @@
# https://docs.weblate.org/en/latest/admin/install.html#production-cron
# Fulltext index updates
*/5 * * * * weblate DJANGO_SETTINGS_MODULE="weblate.settings" __FINALPATH__/venv/bin/weblate update_index
*/5 * * * * __APP__ export DJANGO_SETTINGS_MODULE="weblate.settings" && cd __FINALPATH__ && venv/bin/weblate update_index
# Cleanup stale objects
@daily weblate DJANGO_SETTINGS_MODULE="weblate.settings" __FINALPATH__/venv/bin/weblate cleanuptrans
@daily __APP__ export DJANGO_SETTINGS_MODULE="weblate.settings" && cd __FINALPATH__ && venv/bin/weblate cleanuptrans
# Commit pending changes after 96 hours
@hourly weblate DJANGO_SETTINGS_MODULE="weblate.settings" __FINALPATH__/venv/bin/weblate commit_pending --all --age=96 --verbosity=0
@hourly __APP__ export DJANGO_SETTINGS_MODULE="weblate.settings" && cd __FINALPATH__ && venv/bin/weblate commit_pending --all --age=96 --verbosity=0

View file

@ -239,6 +239,7 @@ ynh_app_setting_set "$app" memc_port "$memc_port"
# SETUP CRON
#=================================================
cp ../conf/cron "/etc/cron.d/$app"
ynh_replace_string "__APP__" "$app" "/etc/cron.d/$app"
ynh_replace_string "__FINALPATH__" "$final_path/" "/etc/cron.d/$app"
#=================================================

View file

@ -270,6 +270,13 @@ fi
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/venv/lib/python2.7/site-packages/weblate/settings.py"
#=================================================
# SETUP CRON
#=================================================
cp ../conf/cron "/etc/cron.d/$app"
ynh_replace_string "__APP__" "$app" "/etc/cron.d/$app"
ynh_replace_string "__FINALPATH__" "$final_path/" "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================