From 0548b8bd4a4459e5bb9d57335955e29d3a3b4dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 6 Aug 2023 16:18:31 +0200 Subject: [PATCH] fix --- scripts/backup | 7 +++++++ scripts/install | 3 +++ scripts/remove | 2 ++ 3 files changed, 12 insertions(+) diff --git a/scripts/backup b/scripts/backup index f8e82aa..b49e9de 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,11 +27,18 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP SYSTEMD #================================================= ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup --src_path="/etc/systemd/system/${app}-web.service" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 89f9c3f..1c8257b 100755 --- a/scripts/install +++ b/scripts/install @@ -24,6 +24,9 @@ ynh_add_systemd_config --service="${app}-web" --template="deluge-web.service" yunohost service add $app --description="Lightweight BitTorrent client" --log="/var/log/$app/$app.log" yunohost service add ${app}-web --description="BitTorrent UI" --log="/var/log/$app/$app.log" +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + mkdir -p /var/log/$app chown -R $app:$app /var/log/$app chmod -R 750 /var/log/$app diff --git a/scripts/remove b/scripts/remove index a950a6e..f865398 100755 --- a/scripts/remove +++ b/scripts/remove @@ -33,6 +33,8 @@ ynh_remove_systemd_config ynh_remove_nginx_config +ynh_remove_logrotate + ynh_secure_remove --file="/var/log/$app" #=================================================