That's what the cp -r does. Did you try one of those commands and it did not work? What did happen?
But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)
| [reply] [d/l] |
Maybe you can show some examples of what you have as source directory structure and target directory structure and how both source and target are specified. Then we can better advise you on the approach to take.
| [reply] |
sure... so the source directory is like :
/proj/tool/STAGE/<ENV>/<CLIENT>/*.xml
and the target dir is like:
/proj/tool/PROD/<ENV>/<CLIENT>
Where in both cases the <ENV> can be something like:
Env A,Env B and so on
and Client can be Client A and Client B and so on.
but ideally the script should be able to copy files from source to target.
something like :
cp /proj/tool/STAGE/EnvA/ClientA/*.xml /proj/tool/PROD/EnvA/ClientA
cp /proj/tool/STAGE/EnvA/ClientB/*.xml /proj/tool/PROD/EnvA/ClientB
cp /proj/tool/STAGE/EnvB/ClientC/*.xml /proj/tool/PROD/EnvB/ClientC
Let me know if more information is needed.
| [reply] |
In which part would, for example, File::Copy::Recursive fail? Just call it for (say) /proj/tool/STAGE/EnvA/ClientA/ to /proj/tool/PROD/EnvA/ClientA/ and so on.
Also see glob and readdir, where glob is the much better approach.
| [reply] [d/l] [select] |