The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Symbolic Links - BASH Script rodrimuino Shell Programming and Scripting 4 09-05-2007 07:42 PM
Symbolic Links rcarnesiii AIX 1 08-17-2005 11:57 AM
Too many levels of symbolic links Bab00shka UNIX for Dummies Questions & Answers 2 09-19-2003 09:15 AM
Symbolic Links for a File b_u_n_1234 UNIX for Dummies Questions & Answers 4 03-06-2002 09:58 AM
Finding symbolic links mehtad UNIX for Dummies Questions & Answers 2 11-15-2001 03:26 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-10-2004
Registered User
 

Join Date: Aug 2004
Posts: 9
cp a dty without symbolic links?

Hi,

- we have copy (cp command) to do to save all the contents of a dty BUT we dont want to copy the files corresponding to symbolic links contained whithin this dty

- the box is a sun solaris one - and the cp commande do not say avything about that?

thanks for help
Jakez
__________________
JAKEZ
Reply With Quote
Forum Sponsor
  #2  
Old 09-10-2004
Registered User
 

Join Date: Aug 2004
Location: vernon-fr
Posts: 28
Exclude the links of the list to copy :
ksh
cd dty
for file in $(find . ! -type l)
do
cp -pr $file backup_dty
done

In case you want a tool for backup try rsync :www.samba.org/rsync)
Reply With Quote
  #3  
Old 09-10-2004
Registered User
 

Join Date: Aug 2004
Posts: 9
hello guy,

- thanks for replying

- i tried your script but if we have a link in the dty to copy the dty which is pointed to by the link is copied also !! even when executing the cmde: "find . ! -type l" when we are in the dty to copy the link does not appear !!!!

- where is the error?
jakez
__________________
JAKEZ
Reply With Quote
  #4  
Old 09-10-2004
Registered User
 

Join Date: Aug 2004
Location: vernon-fr
Posts: 28
Sorry I missed the first line returned by the find command (the dot)
The following code should work:
ksh
cd dty
for file in $(ls)
do
[ ! -h "$file" ] && cp -pr "$file" bkp_dty
done
Reply With Quote
  #5  
Old 09-20-2004
Registered User
 

Join Date: Aug 2004
Posts: 9
Hi chap,

- the last script you gave me makes again the copy of the symbolic link (he type "l" file listed by ls

- some idea for not copying the link??

thanks a lot
Jakez
__________________
JAKEZ
Reply With Quote
  #6  
Old 09-20-2004
pressy's Avatar
solaris cultist
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 718
..............

have a look at:
find ./ ! -follow | cpio -pdmuv /new/directory

greetings pressy
Reply With Quote
  #7  
Old 09-21-2004
Registered User
 

Join Date: Aug 2004
Posts: 9
Hi pressy,

- what do you mean with 'follow' in your cmde:
find ./ ! -follow | cpio -pdmuv /new/directory

thanks
Jakez
__________________
JAKEZ
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
cpio

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0