From 0cd4aa44c0c9e9aa4bd6803e7f71381563ca6645 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sat, 15 Feb 2020 00:39:11 +0100
Subject: [PATCH] Fix.

---
 buster/setup_scripts/backup_app.sh | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/buster/setup_scripts/backup_app.sh b/buster/setup_scripts/backup_app.sh
index cd453ad..9b37b14 100755
--- a/buster/setup_scripts/backup_app.sh
+++ b/buster/setup_scripts/backup_app.sh
@@ -4,7 +4,6 @@ set -x
 
 if [ "$#" -lt 3 ]; then
     echo 'Need at least three arguments: service name, DB name, and backup directory names.'
-    #echo 'Need at least two arguments: service name and backup directory or (prefixed with "db:") DB names.'
     false
 fi
 app="$1"
@@ -20,17 +19,9 @@ service "${app}" stop
 
 su postgres -lc "pg_dump -d ${db_name} --format=custom -f /tmp/${app}_backup/${db_name}.pgdump"
 for target in "$@"; do
-    mkdir -p "${app}_backup${target}"
+    mkdir -p $(dirname "${app}_backup${target}")
     cp -a "${target}" "${app}_backup${target}"
 done
-#for target in "$@"; do
-#    prefix=$(echo "${target}" | cut -c-3)
-#    if [ "${prefix}" = "DB:" ]; then
-#        db_name=$(echo "${ŧarget}" | cut -c4-)
-#    else
-#        cp -a "${target}" "backup${target}"
-#    fi
-#done
 
 tar cf "${app}_backup.tar" "${app}_backup"
 rm -rf "${app}_backup"
-- 
2.30.2