From f8500530489b3030600e3e97d426b96824d872a6 Mon Sep 17 00:00:00 2001 From: opi Date: Sat, 7 May 2016 01:44:03 +0200 Subject: [PATCH] [enh] Use latest backup specification. --- scripts/backup | 10 ++++++++-- scripts/restore | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 794238a..43d8503 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,5 +1,11 @@ #!/bin/bash +# causes the shell to exit if any subcommand or pipeline returns a non-zero status +set -e + +# Source YNH helpers +. /usr/share/yunohost/helpers + app=${!#} # Retrieve arguments @@ -9,7 +15,7 @@ backup_dir=$1 domain=$(sudo yunohost app setting "$app" domain) # Save sources & data -sudo cp -a "/var/www/${app}" ./sources +ynh_backup "/var/www/${app}" "sources" # Copy NGINX configuration -sudo cp -a "/etc/nginx/conf.d/${domain}.d/${app}.conf" ./nginx.conf +ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" diff --git a/scripts/restore b/scripts/restore index 660458a..211396c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,5 +1,8 @@ #!/bin/bash +# causes the shell to exit if any subcommand or pipeline returns a non-zero status +set -e + app=${!#} # Retrieve arguments