From fe21defa68bdde82f5ce980df5206be75bdb0b8e Mon Sep 17 00:00:00 2001 From: Laurent GAY Date: Thu, 14 Dec 2023 20:38:27 +0100 Subject: [PATCH] correct backup/restore --- scripts/backup | 3 +-- scripts/remove | 2 -- scripts/restore | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/backup b/scripts/backup index a2c5e75..79ebbda 100644 --- a/scripts/backup +++ b/scripts/backup @@ -21,8 +21,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Backing up the postgresql database..." -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) +ynh_psql_dump_db --database="$db_name" > dbbackup.sql #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index a8c5926..57b324a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -20,8 +20,6 @@ ynh_remove_nginx_config ynh_remove_logrotate -ynh_remove_fail2ban_config - ynh_secure_remove --file="/var/log/$app" #================================================= diff --git a/scripts/restore b/scripts/restore index 1e98330..4ef3abb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,7 +27,7 @@ check_params ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < dbbackup.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS