From b30eafd9e8cd8221a713be52075bb53608ad5550 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Tue, 4 Aug 2020 20:20:41 +0200 Subject: [PATCH] Minor backup/restore changes --- scripts/backup | 19 ++++++++++++++----- scripts/restore | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index f0af6cd..9440f6f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -33,24 +33,33 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= # STANDARD BACKUP STEPS +#================================================= + +ynh_print_info --message="Declaring files to be backed up..." + +# N.B.: the following 'ynh_backup' calls are only a *declaration* of what needs +# to be backuped and not an actual copy of any file. The actual backup that +# creates and fill the archive with the files happens in the core after this +# script is called. Hence ynh_backups calls takes basically 0 seconds to run + #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=2 +ynh_print_info --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path="$final_path/var/log/$app/error.log" #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up Netdata configuration directory..." --weight=1 +ynh_print_info --message="Backing up Netdata configuration directory..." ynh_backup --src_path="$final_path/etc/netdata" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1 +ynh_print_info --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -61,7 +70,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_print_info --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/var/log/$app/error.log" @@ -69,4 +78,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/ # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/restore b/scripts/restore index a851615..3e55786 100644 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME