So, do it from /Īssumptions: You have the same users and groups created on the destination server as you do on the source server. If you run it from /tmp, it will look for u02 in tmp. Note: run this command from the "/" filesystem. Now I will extract the archive which will create the directory structures I want (with the appropriate owners and permissions). # scp /tmp/*.cpio destination_server_here :/tmp/. Now using "scp" I can copy these files to the server I want to recreate the directory structure on. # find /u02/prn/oradata -type d | cpio -ov >/tmp/oradatadirs.cpio # find /u02/prn/app -type d | cpio -ov >/tmp/appdirs.cpio On the server you want to model the directory structure(s) after you would run the following commands. I wanted to recreate the following two directory structures (including all sub-directories, which there are many of): There is another, and in my opinion more efficient, way to do this using the cpio command. Historically, I would have used the tar command for this and only selected directories. As I build or rebuild servers that need a particular directory structure, I wanted a fast way to replicate or reproduce the empty directory structure with the appropriate owners and permissions.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |