diff --git a/scripts/backup b/scripts/backup index f131305..d4ad152 100644 --- a/scripts/backup +++ b/scripts/backup @@ -40,6 +40,12 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="/etc/vikunja/config.yml" ynh_backup --src_path="/opt/vikunja" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index b5a65c2..8807c89 100644 --- a/scripts/install +++ b/scripts/install @@ -138,6 +138,18 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_add_systemd_config +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --time --weight=1 + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + +mkdir -p /var/log/$app +touch /var/log/$app/$app.log +chown $app -R /var/log/$app + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index a5f7ea0..cd1ec4c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -96,6 +96,14 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" +chown $app -R /var/log/$app + #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================