From e9dc347468c4a67a9d7031c3383bc0bfeb1d45c3 Mon Sep 17 00:00:00 2001 From: Lionel Coupouchetty-Ramouchetty Date: Sun, 23 Feb 2020 12:23:56 +0100 Subject: [PATCH] fix: last listed app not being backed up --- conf/backup-with-borg.j2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/conf/backup-with-borg.j2 b/conf/backup-with-borg.j2 index d2b9f1b..347cdb4 100644 --- a/conf/backup-with-borg.j2 +++ b/conf/backup-with-borg.j2 @@ -30,7 +30,14 @@ fi # Backup all apps independently apps=$(yunohost app setting {{ app }} apps) for app in $(yunohost app list --installed -b | grep id: | cut -d: -f2); do - if [[ "$apps" = *"$app,"* ]] || [ "$apps" = "all" ]; then + backup_app=false + for selected_app in $(echo $apps | tr "," " ");do + if [[ "$selected_app" == "$app" ]] || [ "$apps" = "all" ]; then + backup_app=true + break + fi + done + if [ "$backup_app" == "true" ];then yunohost backup create $ignore_system -n auto_$app --method {{ app }}_app --apps $app fi done