I want to copy files listed in a text file with absolute paths to another folder preserving the folder tree in the destination.
in2.txt:
//PMDA-SO5632/data/vision_6830/image_data/top_surface/nok/220104/inner_rim_220110T070720.*
//PMDA-SO5632/data/vision_6830/image_data/top_surface/nok/220104/inner_rim_220110T064927*
//PMDA-SO5632/data/vision_6830/image_data/top_surface/nok/220104/inner_rim_220110T070210.xml
I want the source folder tree preserved within the output folder.
outd=/cygdrive/c/0/out27/
rsync -vR --include-from=in2.txt / $outd
results in the following and copies nothing:
$ rsync -vR --include-from=in2.txt / $outd
skipping directory /.
sent 17 bytes received 12 bytes 19.33 bytes/sec
total size is 0 speedup is 0.00
trying cp with --parents:
while read p; do
cp --parents "$p" $outd # i had problem with unc path //corp-fs01
done <in2.txt
Yields..
//PMDA-SO5632/data/vision_6830/image_data/top_surface/nok/220104/inner_rim_220110T070210.xml
cp: failed to get attributes of '/PMDA-SO5632': No such file or directory
How can I achieve the copy? It doesn't have to be rsync or cp.
read -r
kind of mandatory).