From f9ab41c4b8b3da84f3c6d58dcc124e339210248d Mon Sep 17 00:00:00 2001 From: redxef Date: Sun, 16 Aug 2020 16:36:51 +0200 Subject: [PATCH] Chown correctly. --- dvbackup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvbackup.sh b/dvbackup.sh index e77e418..ac2436b 100755 --- a/dvbackup.sh +++ b/dvbackup.sh @@ -15,7 +15,7 @@ backup() { test -z "$target_name" && { echo "Error: No target name found for target=$target" >&2; exit 3; } set -x - docker run --rm --user="$(id -u):$(id -g)" --mount="type=volume,source=$volume,destination=/data,ro=true" --mount="type=bind,source=$target_dir,destination=/data2" busybox tar cvf "/data2/$target_name" "/data" + docker run --rm --user="$(id -u):$(id -g)" --mount="type=volume,source=$volume,destination=/data,ro=true" --mount="type=bind,source=$target_dir,destination=/data2" busybox /bin/sh -c "tar cvf '/data2/$target_name' /data && chown $(id -u):$(id -g) /data2/$target_name" set +x }