From 16c3f101526ee6c3b1df0a93db6e4ab62db45212 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 19 Apr 2020 15:08:55 +0200 Subject: [PATCH] backup of /var/data during upgrade --- scripts/upgrade | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0dbb5b4..c4c059f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -105,9 +105,8 @@ then if [ -d $final_path/var/invoices ]; then cp -af "$final_path/var/invoices" "$tmpdir/." fi - if [ -f $final_path/var/data/kimai.sqlite ]; then - cp -a "$final_path/var/data/kimai.sqlite" "$tmpdir/." - ynh_app_setting_set $app database "sqlite" + if [ -d $final_path/var/data ]; then + cp -af "$final_path/var/data" "$tmpdir/." fi # Download, check integrity, uncompress and patch the source from app.src @@ -120,8 +119,8 @@ then if [ -d $tmpdir/invoices ]; then cp -af "$tmpdir/invoices" "$final_path/var/." fi - if [ -f $tmpdir/kimai.sqlite ]; then - sudo cp -af "$tmpdir/kimai.sqlite" "$final_path/var/data/." + if [ -d $tmpdir/data ]; then + cp -af "$tmpdir/data" "$final_path/var/." fi ynh_secure_remove --file="$tmpdir"