From 35055d1adb67ccb60537cf9b1356833ef299be77 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Jun 2021 09:36:11 +0200 Subject: [PATCH] Update restore --- scripts/restore | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/restore b/scripts/restore index d8d606d..51a327f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,6 +48,14 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -60,23 +68,16 @@ chmod 750 "$final_path/bootstrap/cache" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # RESTORE DATA #================================================= -ynh_script_progression --message="Restoring $app data..." +ynh_script_progression --message="Restoring the data directory..." # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. ynh_restore_file --origin_path="$public_path" --not_mandatory chmod 755 "$public_path" +chmod -R o-rwx "$public_path" chown -R $app:www-data "$public_path" #=================================================