1832155 Members
3486 Online
110038 Solutions
New Discussion

Remote copy files

 
SOLVED
Go to solution
Patrick Chim
Trusted Contributor

Remote copy files

Hi,

I have two machines A and B. I use 'rcp -pr' to copy files/subdirectory from A to B by means of a script running with root in B. But the owner of all files in B always changed to root even though I have used the '-p' option (some originally with owner informix). Do I need to tar all the files in A and untar in B ?
If so, is there a one-line command I can do that (e.g. tar files in A | dd ... | tar -xv ... ) ?

Regards,
Patrick
1 REPLY 1
federico_3
Honored Contributor
Solution

Re: Remote copy files


you can use the following :

in A
#cd DIR_to_copy
#tar cf - . | remsh B "cd DEST_dir_to_copy_DIR && tar xf -"


federico