AllExperts > Experts 
Search      

Sun Operating System

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Sun Operating System Answers
Question Library

Ask a question about Sun Operating System
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About John Storta, Jr.
Expertise
I am a Sun Certified Solaris Administrator. I can answer virtually any question relating to the administration of Sun servers. I have experience installing hardware, managing user accounts, maintaining file systems, setting up backup and recovery plans, configuring Veritas NetBackup, and general troubleshooting.

Experience
I have been a UNIX System Administrator for 5 years. I have implemented 5 systems as a Project Leader. I have seen a wide range of problems over the years and found solutions for all of them.

Organizations
Independant Computer Consultants Association

Education/Credentials
Sun Certified Solaris Administrator
Training in Oracle SQL and Veritas NetBackup
30+ university level Computer Science credits

Awards and Honors
Received outstanding service award for my achievements
Recognized by VP and CEO following system implementation

 
   

You are here:  Experts > Computing/Technology > Focus on PC Support > Sun Operating System > Copying links under Solaris

Topic: Sun Operating System



Expert: John Storta, Jr.
Date: 4/10/2001
Subject: Copying links under Solaris

Question
Hello,
I am trying to duplicate certain small portions of a disk which includes directories, files and soft-links. But when I use "cp [options]" it seems that the soft-link target is copied rather than the soft-link as it is. Is there some switch (or some other way) to copy a small directory structure such that the soft-links will be retained?
What I would like is a mirror image.

Thanks in advance.
Steve


Answer
I am pretty sure this should work.  I use it when copying entire directory structures to a different file system.

1)  use mkdir to create the new directory where you want it.

2)  cd into the directory you want to copy

3)  Run this command.

find . -depth -print | cpio -pvdum /<new directory path>

4)  This should copy everything from its current location to the new directory while leaving all of the file permissions, ownership, and links.

The key to this command is that you must be in the directory that you want to copy.  It basically copies all files and directories from your current location on down to the new directory.

Let me know if you have any problems.

John Storta, Jr.
Sun Certified Solaris Administrator
Member ICCA
www.perspectivesystems.50megs.com  

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.