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.

So if I need to preserve the permissions/user/group infos of files then I can copy them with "cp -p foo fooo". But are there any "preserving" options in scp? When copying between servers.

share|improve this question
2  
I can't speak for others, but I suspect the downvotes are because this information is easily found by using man, which should be the first source of information when wanting to know more about a utility. I would encourage people not to downvote a question for that reason. See the discussion here: meta.unix.stackexchange.com/questions/203/… –  Shawn J. Goff Oct 29 '11 at 20:49
    
ty, but where can you see this in the "man"? -->> "preserve the permissions/user/group" ? –  LanceBaynes Oct 30 '11 at 9:05
add comment

1 Answer

up vote 3 down vote accepted

From my experience I can say that scp -pdoes NOT work as expected.

I use rsync -e ssh -aHS SOURCE TARGET instead, This will retain almost all attributes - only the creation time of soft links will change to the current time.

share|improve this answer
2  
Really? It generally works just fine for me. How exactly does not not work for you, and on what system(s)? –  Keith Thompson Oct 29 '11 at 22:27
    
@KeithThompson Sorry for the late answer to your comment. I have this problem (soft-link-time) on CentOS 5.8 and SLES10 SP4. I found no system call that is able to change the time of a soft-link (on these systems) - perhaps that is the source of the problem. –  Nils Jun 10 '12 at 21:05
add comment

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.