Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 at http://i.stack.imgur.com/bSciQ.png

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
1  
Do you have too many files in that folder? Also please mind case (jpg is no the same as JPG). –  LatinSuD Jun 9 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 at 17:00
    
How long do you let it run until you press ^C ? –  LatinSuD Jun 9 at 18:59
    
@LatinSuD 30 minutes –  Kevin S Jun 10 at 11:59

3 Answers 3

up vote 1 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 at 12:00
    
get worked but I had to wait 8 hours to copy entire files. Thanks –  Kevin S Jun 11 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

Your Answer

 
discard

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.