From 06a6586ee474602ff4924cdc053a6ef175fc1249 Mon Sep 17 00:00:00 2001 From: Lionel Coupouchetty-Ramouchetty Date: Fri, 2 Apr 2021 12:20:32 +0200 Subject: [PATCH] fix: missing log files --- manifest.json | 2 +- scripts/install | 10 ++++++++++ scripts/upgrade | 11 +++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 7b55cd4..6b18712 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~ynh9", + "version": "0.12.0~ynh10", "url": "https://restic.net/", "license": "BSD-2-Clause", "maintainer": { diff --git a/scripts/install b/scripts/install index 3db6785..e0ee9cf 100755 --- a/scripts/install +++ b/scripts/install @@ -106,6 +106,16 @@ systemctl start ${app}_check_read_data.timer ynh_script_progression --message="Set permissions on ${final_path}" chown -R ${app}: ${final_path} +#================================================= +# FIX https://github.com/ashemsay/restic_ynh/issues/17 +#================================================= +for log in restic_backup_${app}.log restic_backup_${app}.err restic_check_${app}.log restic_check_${app}.err;do + if [ -d "/var/log/${log}" ];then + rmdir /var/log/${log} + fi + touch /var/log/${log} + chown ${app}: /var/log/${log} +done #================================================= # SETUP LOGROTATE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2c648e5..3607cc9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,6 +149,17 @@ systemctl start ${app}.timer systemctl start ${app}_check.timer systemctl start ${app}_check_read_data.timer +#================================================= +# FIX https://github.com/ashemsay/restic_ynh/issues/17 +#================================================= +for log in restic_backup_${app}.log restic_backup_${app}.err restic_check_${app}.log restic_check_${app}.err;do + if [ -d "/var/log/${log}" ];then + rmdir /var/log/${log} + fi + touch /var/log/${log} + chown ${app}: /var/log/${log} +done + #================================================= # SETUP LOGROTATE #=================================================