Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 am trying to copy multiple (1000s) .JPG files from remote SFTP server to current server using mget command but it is not working. Here is the command that I used

sftp username@sftp.domain.com
sftp> cd /images
sftp> mget *.JPG

Screenshot:

enter image description here

Nothing happens so when I do CTRL + C it gives an error that says File "/images/*.JPG" not found.

I have already referred all suggestions posted on the forum but nothing is working. Let me know if there is another way to copy.

share|improve this question

closed as off-topic by Jenny D, Ward, MadHatter, mdpc, HopelessN00b Mar 10 at 7:11

This question appears to be off-topic. The users who voted to close gave these specific reasons:

If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Do you have too many files in that folder? Also please mind case (jpg is no the same as JPG). – LatinSuD Jun 9 '14 at 16:58
    
Hi @LatinSuD yes, there are around 30000 files and all the files ends with .JPG not .jpg so it is not case sensitive? – Kevin S Jun 9 '14 at 17:00
    
How long do you let it run until you press ^C ? – LatinSuD Jun 9 '14 at 18:59
    
@LatinSuD 30 minutes – Kevin S Jun 10 '14 at 11:59
up vote 3 down vote accepted

If I am not mistaken, and it may be version/flavor dependent, sftp does not have an mget option as ftp does. Assuming this is a *nix type system, take a look at the man page to verify syntax. It may be that trying get instead of mget will work.

share|improve this answer
    
I did tried get but it goes to blank as shown in the image at i.stack.imgur.com/bSciQ.png – Kevin S Jun 10 '14 at 12:00
    
get worked but I had to wait 8 hours to copy entire files. Thanks – Kevin S Jun 11 '14 at 15:41

Try using a plain get, from the man page

Retrieve the remote-path and store it on the local machine. If the local path name is not specified, it is given the same name it has on the remote machine. remote-path may contain glob(3) characters and may match multiple files. If it does and local-path is specified, then local-path must specify a direc- tory.

Alternatively you could use scp.

share|improve this answer

Why not use

scp -r username@sftp.domain.com:/fullpath/images/*.JPG /your/path/destination

Note that the names are case sensitive and verify if you are in the correct path on your cd command.

share|improve this answer

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