From 1a0a51caab1f0c35096498a2bd7ed5e01fb8d9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 13 Jan 2018 21:31:48 +0100 Subject: [PATCH] Add backup before upgrade --- .gitignore | 8 -------- scripts/upgrade | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 15571ae..0000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.gitignore - -# From kateproject -.kateproject -.kateproject.d -.directory - -.kate-swp diff --git a/scripts/upgrade b/scripts/upgrade index b73ff7f..00c4344 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,17 @@ dbpass=$(ynh_app_setting_get "$app" mysqlpwd) # Stop services systemctl stop monitorix.service +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + # Download package and install it get_install_source