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

link|improve this question

64% accept rate
feedback

3 Answers

up vote 7 down vote accepted

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

Rsync uses secure copy.

link|improve this answer
2  
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 at 17:31
feedback

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?

link|improve this answer
feedback

You can simply move the excluded folder to another path and then scp the parent folder. At the end, re-move the folder to its original location.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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