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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cecilchampenois
Forum Commoner
Posts: 47
Joined: Thu Nov 06, 2014 10:29 am
Location: Gilbert, Arizona
Contact:

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

Post 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
Cecil Champenois
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

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

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

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

Post by Weirdan »

*.* matches only those names with a dot. Your folders, I bet, don't have a dot, while your files likely have.
cecilchampenois
Forum Commoner
Posts: 47
Joined: Thu Nov 06, 2014 10:29 am
Location: Gilbert, Arizona
Contact:

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

Post by cecilchampenois »

Yep, I got rid of the *.*.

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

Thanks!
Cecil Champenois
Post Reply