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" #=================================================