So here's an excerpt of my directory tree:
|-- 20070214_014700.a
| |-- info
| |-- processed
| |-- HH.EL..BHZ
| |-- AZ.AS..HHZ
| |-- (hundreds more)
| |-- raw
| |-- resp
|-- 20100737_055560.a
| |-- info
| |-- processed
| |-- raw
| |-- resp
|-- 20190537_028750.a
| |-- info
| |-- processed
| |-- raw
| |-- resp
I have ~13,000 directories (ending in .a) and each directory has a 'processed' subdirectory which has files I'd like to copy from every processed/ directory into a single directory. Some of these files may have the same filename so I'd also like to rename them based on their parent directory. I'm not too picky but something similar to:
20070214_014700_HH.EL..BHZ
The whole dataset is 3 TB so I've been testing on just a few directories using 'find':
find . -name processed -exec cp -r '{}' 'test/{}' \;
For some reason this dumps some files into test/ but also creates another processed/ directory inside of that. I'm not sure how to include a copy command and renaming function into find at the same time so any advice would be great. Thanks for the help.