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.
This commit is contained in:
HW42 2016-08-28 18:35:03 +02:00 committed by Marek Marczykowski-Górecki
parent 1a601ddbe9
commit be0e8a250f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

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