Chown correctly.

This commit is contained in:
redxef 2020-08-16 16:36:51 +02:00
parent 354f9cabaa
commit f9ab41c4b8

View file

@ -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
}