After having run several simulations on a cluster, I would like to copy the results back to my local machine. The results are organised is as follows:
foo1
|bar1
|run1
|file1.txt
|file2.txt
|results.txt
|run2
|file1.txt
|file2.txt
|results.txt
|bar2
|run1
|file1.txt
|file2.txt
|results.txt
|run2
|file1.txt
|file2.txt
|results.txt
foo2
... (etc.)
Each run*
folder contains several files, needed to run the simulation, but I am only interested in copying the results, say results.txt
back to my local machine while maintaining the rest of the tree structure (the directories basically specifies the parameters for the simulation).
How can I now copy only the results.txt
files from remote to local, while maintaining the tree structure of the directories? Such that I on local end up with
foo1
|bar1
|run1
|results.txt
|run2
|results.txt
|bar2
|run1
|results.txt
|run2
|results.txt
foo2
... (etc.)