LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Copy directory structure? (http://www.linuxquestions.org/questions/programming-9/copy-directory-structure-329149/)

tpe 06-01-2005 08:09 AM

Copy directory structure?
 
Hallo,
On my linux server under a 'storage' directory, I have a directory structure in the form of year/month/day/articlecategory
I have to duplicate that structure (just the structure, not the files) on a couple of other directories. Since:
a) I do not want to copy the files,
b) I do not have PHP on that server and I know too little perl to do the job,
do you know any kind of shell script that will do that?

Thank you in advance,
Peter

eddiebaby1023 06-01-2005 08:30 AM

find storage -type d -print | cpio -pvdum /name/of/target/directory

should do the trick.

tpe 06-02-2005 05:59 AM

Thank you for your answer.
I will try it and will post if it worked.


All times are GMT -5. The time now is 03:29 AM.