From be0e8a250f5cb0698120a98ea6f9be34fc12d9cf Mon Sep 17 00:00:00 2001 From: HW42 Date: Sun, 28 Aug 2016 18:35:03 +0200 Subject: [PATCH] bind-dirs: copy from ro only if bind target doesn't exists f4d367a6 dropped the check if the bind target exists and added "--no-clobber" to the cp call. For directories this does not work as desired: cp checks per (recursive) file instead of once for the specified directory. --- vm-systemd/bind-dirs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vm-systemd/bind-dirs.sh b/vm-systemd/bind-dirs.sh index 70745c1..c364e8c 100755 --- a/vm-systemd/bind-dirs.sh +++ b/vm-systemd/bind-dirs.sh @@ -95,7 +95,9 @@ bind_dirs() { # Initially copy over data directories to /rw if rw directory does not exist. if [ -d "$fso_ro" ] || [ -f "$fso_ro" ]; then - cp --verbose --no-clobber --archive --recursive --parents "$fso_ro" "$rw_dest_dir" + if ! [ -d "$fso_rw" -o -f "$fso_rw" ]; then + cp --verbose --archive --recursive --parents "$fso_ro" "$rw_dest_dir" + fi else true "$fso_ro is neither a directory nor a file or does not exist, skipping." continue