0

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.

  • 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
3

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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