From f028b7f2afffd1fb60451a3d06ab861199268331 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 18 Mar 2019 04:22:38 +0100 Subject: Apply example_ynh --- scripts/backup | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts/backup') diff --git a/scripts/backup b/scripts/backup index eeee720..5e57cd7 100644 --- a/scripts/backup +++ b/scripts/backup @@ -26,8 +26,8 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= +ynh_print_info "Loading installation settings..." -# Get multi-instances specific variables app=$YNH_APP_INSTANCE_NAME # Retrieve app settings @@ -47,18 +47,21 @@ yunohost service stop "$app-streaming" #================================================= # BACKUP THE APP MAIN DIR #================================================= +ynh_print_info "Backing up the main app directory..." ynh_backup "$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= +ynh_print_info "Backing up nginx web server configuration..." ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= -# BACKUP THE MYSQL DATABASE +# BACKUP THE POSTGRESQL DATABASE #================================================= +ynh_print_info "Backing up the PostgreSQL database..." ynh_psql_dump_db "$db_name" > db.sql ynh_backup "db.sql" @@ -68,6 +71,7 @@ ynh_backup "db.sql" #================================================= # BACKUP SYSTEMD #================================================= +ynh_print_info "Backing up systemd configuration..." ynh_backup "/etc/systemd/system/$app-web.service" ynh_backup "/etc/systemd/system/$app-sidekiq.service" @@ -97,3 +101,9 @@ sleep 30 #================================================= systemctl reload nginx + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." -- cgit v1.2.3-70-g09d2