diff --git a/scripts/backup b/scripts/backup index 13aaf8a..4765186 100755 --- a/scripts/backup +++ b/scripts/backup @@ -37,10 +37,10 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) ynh_print_info --message="Declaring files to be backed up..." #================================================= -# BACKUP THE APP MAIN DIR +# BACKUP THE APP DATA DIRS #================================================= -ynh_backup --src_path="$final_path" --is_big +ynh_backup --src_path="$final_path/data" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 428d3fc..20c21e9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -57,17 +57,6 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 - -ynh_restore_file --origin_path="$final_path" - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # INSTALL NODEJS #================================================= @@ -84,6 +73,17 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=7 cd $final_path && ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install +#================================================= +# RESTORE THE APP DATA DIR +#================================================= +ynh_script_progression --message="Restoring the app data directory..." --weight=1 + +ynh_restore_file --origin_path="$final_path/data" + +chmod 750 "$final_path/data" +chmod -R o-rwx "$final_path/data" +chown -R $app:www-data "$final_path/data" + #================================================= # RESTORE VARIOUS FILES #=================================================