1834613 Members
3236 Online
110069 Solutions
New Discussion

Re: A Newbie Question

 
SOLVED
Go to solution
Devon Ainsworth
Occasional Contributor

A Newbie Question

What I want to do is, copy everything from one mount to another one (subdirectories too). I need to have the permissions and user ID/Groups in tacked.

What would be the best way to do this?

Thank You

Devon
7 REPLIES 7
Patrick Wallek
Honored Contributor

Re: A Newbie Question

The real easy way is:

# cd /mountpoint1
# cp -rp . /mountpoint2

Robert-Jan Goossens
Honored Contributor
Solution

Re: A Newbie Question

Hi,

# find /source | cpio -pcmudv /target

Regards,

Robert-Jan
Alzhy
Honored Contributor

Re: A Newbie Question

The safest IMHO is:

vxdump 0f - /oldmnt|(cd /newmnt ; vxrestore rf -)

All file properties preserved, even special files.

Of course you can also use cpio as others have mentioned.

If you insist on TAR, use GNU's version.
Hakuna Matata.
Steven E. Protter
Exalted Contributor

Re: A Newbie Question

If you have it installed the -rp syntax will work for secure shell

scp -rp /mountpoint hostname:/mountpoint2

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Marvin Strong
Honored Contributor

Re: A Newbie Question

with tar

from target directory

(cd /source;tar cf - .)|tar xf -

rvrameshbabu
Advisor

Re: A Newbie Question

Use rsync to copy , it preserves date/ownership .

http://rsync.samba.org/ftp/rsync/binaries/HPUX/
Geoff Wild
Honored Contributor

Re: A Newbie Question

I use vxdump as well:

vxdump -0 -f - -s 1000000 -b 16 /oldmount | (cd /newmount ; vxrestore rf -)

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.