diff --git a/manifest.json b/manifest.json index 7103064..ad59438 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Backup your server with restic.", "fr": "Sauvegardez votre serveur avec restic." }, - "version": "0.12.0~ynh7", + "version": "0.12.0~ynh8", "url": "https://restic.net/", "license": "BSD-2-Clause", "maintainer": { diff --git a/scripts/install b/scripts/install index 8a8446d..3db6785 100755 --- a/scripts/install +++ b/scripts/install @@ -106,6 +106,15 @@ systemctl start ${app}_check_read_data.timer ynh_script_progression --message="Set permissions on ${final_path}" chown -R ${app}: ${final_path} +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring logrotate" +ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.log +ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.err +ynh_use_logrotate --logfile=/var/log/restic_check_${app}.log +ynh_use_logrotate --logfile=/var/log/restic_check_${app}.err + #================================================= # GENERATE SSH KEY #================================================= diff --git a/scripts/remove b/scripts/remove index a393666..1f0ddf0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -42,6 +42,12 @@ ynh_secure_remove "${final_path}/restic_log_${app}" ynh_secure_remove "${final_path}/restic_check_log_${app}" ynh_secure_remove "${final_path}" +#================================================= +# REMOVE LOGROTATE CONFIG +#================================================= +ynh_script_progression --message="Removing logrotate config" +ynh_remove_logrotate + #================================================= # REMOVE SSH CONFIG #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4cecda6..2c648e5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,7 +149,14 @@ systemctl start ${app}.timer systemctl start ${app}_check.timer systemctl start ${app}_check_read_data.timer -ynh_script_progression --message="End of upgrade process" --last +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring logrotate" +ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.log +ynh_use_logrotate --logfile=/var/log/restic_backup_${app}.err +ynh_use_logrotate --logfile=/var/log/restic_check_${app}.log +ynh_use_logrotate --logfile=/var/log/restic_check_${app}.err #================================================= # UPGRADE SSH CONFIG @@ -178,3 +185,4 @@ Host ${server} # end $app ssh config EOCONF fi +ynh_script_progression --message="End of upgrade process" --last