From 0bd72574ee02f6990540f4c58d3d2f7364c1a51f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 12 Mar 2021 03:14:34 +0100 Subject: [PATCH] Fix backup and restore --- scripts/backup | 3 ++- scripts/restore | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/backup b/scripts/backup index 27a81a3..17439b2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -28,6 +28,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_use_php #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -50,7 +51,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_backup --src_path="$php_version_path/$php_version/etc/php-fpm.d/$app.conf" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 4db340c..6361b33 100755 --- a/scripts/restore +++ b/scripts/restore @@ -81,13 +81,14 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies ynh_install_php --php_version=$php_version +ynh_use_php #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Restoring PHP-FPM configuration..." -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="$php_version_path/$php_version/etc/php-fpm.d/$app.conf" #================================================= # GENERIC FINALIZATION @@ -96,7 +97,7 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload +ynh_systemd_action --service_name=php$php_version-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #=================================================