1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/restic_ynh.git synced 2024-09-03 20:16:22 +02:00

feat: enable log rotation

This commit is contained in:
Lionel Coupouchetty-Ramouchetty 2021-03-21 19:57:50 +01:00
parent 19f633893e
commit 5760096cd1
4 changed files with 25 additions and 2 deletions

View file

@ -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": {

View file

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

View file

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

View file

@ -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