Page 1 of 1

scp -r doesn't copy the directories, only files

Posted: Wed Feb 04, 2015 10:18 am
by cecilchampenois
I've used scp -r root@xxx.xxx.xxx.xxx:/var/www/*.* .

to copy down all the directories and files from the directory www, but it only copies the files. What am I missing?

Maybe it's the *.* part that is making it files only, instead of directories? I am running it now without the *.* and since there are so many files, I have to wait and see if it creates the directories.

Maybe this?

scp -r root@xxx.xxx.xxx.xxx:/var/www/ .

Cecil

Re: scp -r doesn't copy the directories, only files

Posted: Wed Feb 04, 2015 10:32 am
by Celauran
It's not DOS. *.* matches "anything, followed by a literal dot, followed by anything"

For reference: http://linux.die.net/man/1/scp

Re: scp -r doesn't copy the directories, only files

Posted: Wed Feb 04, 2015 10:37 am
by Weirdan
*.* matches only those names with a dot. Your folders, I bet, don't have a dot, while your files likely have.

Re: scp -r doesn't copy the directories, only files

Posted: Wed Feb 04, 2015 4:04 pm
by cecilchampenois
Yep, I got rid of the *.*.

I got it to work without that DOS modaility. Got to stop thinking in DOS.

Thanks!