From 457fda9b17b586d317ee048e3a09123d98306a7f Mon Sep 17 00:00:00 2001 From: Gildas <25692645+Gildas-GH@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:59:20 +0100 Subject: [PATCH 1/2] Debugging --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index b5bbdff..cefb4a7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -71,7 +71,7 @@ mkdir -p "/var/log/$app" chmod 750 "/var/log/$app" chmod -R o-rwx "/var/log/$app" chown -R $app:adm "/var/log/$app" -chown -R $app:$app "/var/lib/$app" +# chown -R $app:$app "/var/lib/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app" From 110c3ff1aa3c8b2e071709be4aa0a8221b6cfdc2 Mon Sep 17 00:00:00 2001 From: Gildas <25692645+Gildas-GH@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:07:08 +0100 Subject: [PATCH 2/2] Directory wasn't backed up --- scripts/backup | 2 ++ scripts/remove | 1 + scripts/restore | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index a0878e7..f76a832 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,6 +27,8 @@ ynh_backup --src_path="$config_path" ynh_backup --src_path="$data_dir" --is_big +ynh_backup --src_path="/var/lib/$app" + #================================================= # SPECIFIC BACKUP #================================================= diff --git a/scripts/remove b/scripts/remove index e1b6a31..789306d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -42,6 +42,7 @@ ynh_secure_remove --file="$config_path" ynh_secure_remove --file="/var/log/$app" ynh_secure_remove --file="/run/$app" +ynh_secure_remove --file="/var/lib/$app" ynh_secure_remove --file="/usr/bin/prosody" ynh_secure_remove --file="/usr/bin/prosodyctl" ynh_secure_remove --file="/usr/bin/prosody-migrator" diff --git a/scripts/restore b/scripts/restore index cefb4a7..7e82900 100755 --- a/scripts/restore +++ b/scripts/restore @@ -51,8 +51,10 @@ chmod 750 "$config_path/certs" ynh_script_progression --message="Restoring the data directory..." ynh_restore_file --origin_path="$data_dir" --not_mandatory +ynh_restore_file --origin_path="/var/lib/$app" --not_mandatory chown -R $app:$app "$data_dir" +chown -R $app:$app "/var/lib/$app" #================================================= # RESTORE SYSTEMD @@ -71,7 +73,6 @@ mkdir -p "/var/log/$app" chmod 750 "/var/log/$app" chmod -R o-rwx "/var/log/$app" chown -R $app:adm "/var/log/$app" -# chown -R $app:$app "/var/lib/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"