Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to SCP an entire directory over to my new server, but exclude the thumbs/ directory inside /storage.

i want to scp over (and everything inside it, and all directories): /storage

but exclude: /storage/thumbs

thank you

share|improve this question
up vote 8 down vote accepted

Use rsync: rsync -av --exclude thumbs /storage dest

Rsync uses secure copy.

share|improve this answer
Actually, it pipes over SSH. But the net result is the same. – Ignacio Vazquez-Abrams Dec 2 '10 at 16:43
How do you rsync to another server? – Andrew Fashion Dec 2 '10 at 16:49
Specify the destination in the form host:dir, such as newserver:/destdir. – James Sneeringer Dec 2 '10 at 17:44
+1: I was about to ask how to do scp recursively. I forgot about rsync. – David W. May 1 '12 at 17:31

Happy to be proven wrong but there's nothing I can see in the man page to suggest you can, presumably you're using '-r' right?

share|improve this answer

Your Answer


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.