1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lutim_ynh.git synced 2024-09-03 19:36:24 +02:00

Fix cron tasks

This commit is contained in:
maniack 2020-01-02 18:43:40 +01:00
parent 58e2919497
commit dec8d0820f
6 changed files with 9 additions and 7 deletions

View file

@ -1,11 +1,11 @@
# Génération des statistiques. Tous les jours, à 5h.
0 5 * * * www-data cd "__FINALPATH__" && $(which carton) exec script/lutim cron stats
0 5 * * * __APP__ cd "__FINALPATH__" && $(which carton) exec script/lutim cron stats
# Suppression des adresses IP obsolètes. Tous les jours, à 6h.
0 6 * * * www-data cd "__FINALPATH__" && $(which carton) exec script/lutim cron cleanbdd
0 6 * * * __APP__ cd "__FINALPATH__" && $(which carton) exec script/lutim cron cleanbdd
# Suppression des images dont le délai a expiré. Tous les jours, à 6h.
0 6 * * * www-data cd "__FINALPATH__" && $(which carton) exec script/lutim cron cleanfiles
0 6 * * * __APP__ cd "__FINALPATH__" && $(which carton) exec script/lutim cron cleanfiles
# Vérification de l'occupation du dossier des images. Tous les jours, à 7h.
0 7 * * * www-data cd "__FINALPATH__" && $(which carton) exec script/lutim cron watch
0 7 * * * __APP__ cd "__FINALPATH__" && $(which carton) exec script/lutim cron watch

View file

@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Checking the disk quota for images stored by lutim..." --weight=9
(cd "$final_path" && $(which carton) exec script/lutim cron watch)
(cd "$final_path" && exec_as $app $(which carton) exec script/lutim cron watch)
#=================================================
# END OF SCRIPT

View file

@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Removing expired images..." --weight=9
(cd "$final_path" && $(which carton) exec script/lutim cron cleanfiles)
(cd "$final_path" && exec_as $app $(which carton) exec script/lutim cron cleanfiles)
#=================================================
# END OF SCRIPT

View file

@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Removing obsolete ip from the database..." --weight=9
(cd "$final_path" && $(which carton) exec script/lutim cron cleanbdd)
(cd "$final_path" && exec_as $app $(which carton) exec script/lutim cron cleanbdd)
#=================================================
# END OF SCRIPT

View file

@ -135,6 +135,7 @@ ynh_add_systemd_config
cp ../conf/cron_lutim /etc/cron.d/$app
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path/" --target_file=/etc/cron.d/$app
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=/etc/cron.d/$app
chmod +x $final_path/script/lutim
#=================================================

View file

@ -223,6 +223,7 @@ fi
cp ../conf/cron_lutim /etc/cron.d/$app
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path/" --target_file=/etc/cron.d/$app
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=/etc/cron.d/$app
#=================================================
# UPDATE LUTIM WITH CARTON