Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to download 800 files from a server to my server. These files have different names and they're in different subdirectories in the remote server, but I have their names on a list. How can I do this on a way that I don't have to go one by one? I can use scp or sftp, but I don't know how to submit a list of files to be downloaded.

Thanks a lot!

share|improve this question
    
What OS do you have on the server you want to download the files to? –  Martin Prikryl Apr 29 '13 at 18:07
    
oops! sorry I forgot to mention, they're both Linux servers. –  user2283859 Apr 29 '13 at 18:16
    
What programming language are you using? –  zespri Apr 29 '13 at 20:34
add comment

migrated from stackoverflow.com Apr 29 '13 at 20:41

This question came from our site for professional and enthusiast programmers.

2 Answers

You should be able to do something like:

wget http://the.source.of.it.all $(< /the/list/of/files/here)

or even run the whole by a script that iterates over the files reading a line from the list and asking for it.

How much do you know of shell programming? How well do you know the command line Unix utilities? Are you familiar with a scripting language, like Perl or Python?

share|improve this answer
add comment

sftp has a -b option to read commands from a batch file. The batch file should contain a list of commands like you would type at the sftp> command prompt.

You could generate a batch file containing get commands for each file that you want to fetch, along with any other commands that you need to issue, like lcd or lmkdir to put the files in the correct local directories.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.