RE: copying directory with symbolic links (SUMMARY)

From: nico osagie <>
Date: Wed Feb 01 2006 - 17:46:44 EST
Hi All,

Sorry for not including the summary of the reply i got. Anyway here the most 
common ones.

I used  " tar cf site.tar /www/data "  then extract using "tar .xvf 

A) use tar.

cd sourcedir
tar cf - . | (cd /destdir && tar xvf -)

B) tar cf - . | (cd /dest-dir && tar xf -)

c) man cp


Check out GNU fileutils package which includes 'cp',
with a lot more options.

Dave Foster

D) If copying from dir-a to dir-b, then:

cd /dir-a
tar cf - . | (cd /dir-b; tar xfp - )

Reggie Beavers

E) if /www/data1 is a partition itself, then the best possible way to copy
it, and only it, and maintain symlinks, is to use a ufsdump piped to
ufsrestore, e.g.:

# cd /www/data2
# ufsdump 0f - /dev/rdsk/c0t0d0s5 | ufsrestore rf -

`cp -pr` works only if you have no symlinks and aren't woried about sub

cd /www/data
find . -depth -print | cpio -pmdf /www/newdata

G) rsync -lra /source/ /target/

kind regards
sunmanagers mailing list
Received on Thu Feb 2 09:04:28 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:55 EST