From e04a518d45ec1c68432fc09ba87772db17ec2933 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Wed, 23 Dec 2020 18:30:41 +0100 Subject: [PATCH] fix restore: create log path and file before chown call see: https://ci-apps.yunohost.org/ci/job/636 --- README.md | 11 +++++++++++ scripts/restore | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de534d5..410294a 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,17 @@ To remove call e.g.: sudo yunohost app remove pyinventory ``` +Backup / remove / restore cycle, e.g.: +```bash +yunohost backup create --apps pyinventory +yunohost backup list +archives: + - pyinventory-pre-upgrade1 + - 20201223-163434 +yunohost app remove pyinventory +yunohost backup restore 20201223-163434 --apps pyinventory +``` + Debug installation, e.g.: ```bash root@yunohost:~# ls -la /var/www/pyinventory/ diff --git a/scripts/restore b/scripts/restore index b0f4dad..1302c03 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,7 +70,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" --use_shell #================================================= # Restore permissions on app files -chown -R "$app" "$log_path" chown -R "$app" "$public_path" chown -R "$app" "$final_path" @@ -111,7 +110,9 @@ yunohost service add $app --description="Web based management to catalog things" # RESTORE THE LOGROTATE CONFIGURATION #================================================= -mkdir -p "/var/log/$app" +mkdir -p "$log_path" +touch "${log_file}" +chown -R "$app" "$log_path" ynh_restore_file --origin_path="/etc/logrotate.d/$app" #=================================================