From ba21122a17027bae5471943bdf585bbd9e47a33f Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 22 Jan 2024 05:37:56 +0100 Subject: [PATCH] fix data dir backup/restore --- scripts/backup | 7 ++++++- scripts/restore | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 8d213cc..b887886 100644 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= @@ -32,7 +38,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_backup --src_path="/etc/$app/" -ynh_backup --src_path="/var/lib/$app/" #================================================= # BACKUP THE POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index 3f07df1..76ac086 100644 --- a/scripts/restore +++ b/scripts/restore @@ -28,13 +28,21 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +chown -R "$app:www-data" "$data_dir" + #================================================= # RESTORE VARIOUS FILES #================================================= ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/$app/" -ynh_restore_file --origin_path="/var/lib/$app/" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"