Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I copy a folder structure from one server to another keeping the same owner and file permissions?

share|improve this question
    
Would you like to comment about why you down voted this question? –  Stuart Woodward Apr 5 '12 at 7:16
    
The question doesn't have any downvotes, so if somebody did downvote it they took it back pretty fast –  Michael Mrozek Apr 6 '12 at 1:43
    
I found some more answers here: superuser.com/questions/81789/… I searched for this question like crazy before posting and I now I have found it again. –  Stuart Woodward Apr 6 '12 at 3:09

2 Answers 2

rsync with -a will copy ownership and permissions. It will even work over ssh.

share|improve this answer

Using -a option with the rsync command you can transfer the file between server under same ownership and perm.

Synchronise between local and remote server

#rsync -avz /source username@192.168.200.10:/destination 

Synchronise between local and remote over ssh.

%rsync -avz -e ssh username@192.168.200.10:/source /destination 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.