Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to make a copy of a directory via SSH? Lets say I have /directory/ and I want to make an exact copy of it to something like /directory_copy/ is it possible?

I'm using CentOS.

Thanks.

share|improve this question

closed as off topic by mailq, Iain, freiheit, womble, voretaq7 Aug 27 '11 at 23:00

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

up vote 2 down vote accepted

Yes. But this is not a SSH thing. It is just a Linux command cp -a directory directory_copy.

share|improve this answer

If you want to do this remotely using ssh use rsync:

rsync -e ssh -aHS SOURCE DESTINATION

SOURCE or DESTINATION migth be a remote host.

The only thing that will be not be copied exactly is the time-stamp of a symbolic link.

share|improve this answer

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