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 am having a very strange problem with the following TFTP command to get two files from a host IP:

tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt

The command executes just fine but when I go to retrieve the files, only the second one shows up as the first one has been omitted. The strange thing is I have used this exact command to pull different numbers of files, and it works with 1 file, 3 files, 4 files, and 5 files (successfully returns all files from the host) BUT for some reason it doesn't work with 2.

tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt MyFile3.txt etc. etc.

Does anyone have a clue why it's leaving out the first file after the get whenever I use only two files?

share|improve this question

migrated from stackoverflow.com Jul 25 '12 at 22:47

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

    
More info is probably needed here as we don't know the details on your environment. what distro are you using? what tftp client are you using? There should be a verbose mode with your tftp client. Try running it in that to see if it provides more insight. Edit your post with updated info when you get it. Also console dumps of the runs are helpful. –  Nate Jul 26 '12 at 4:15

3 Answers 3

If you specify 1 file that file is transferred with the original file name to the local server

If you specify 2 files the first file is transferred using the second file name as a destination on the local server (so in your case file2 on your destination server actually has file1's contents)

If you specify 3 or more files all files are transferred with the original file name to the local server

share|improve this answer

Have you tried:

tftp 173.32.52.12 <<!
   get MyFile1.txt
   get MyFile2.txt
!
share|improve this answer

Here's what my tftp(1) man page says:

 get filename
 get remotename localname
 get file1 file2 ... fileN
          Get one or more files from the remote host.  When using the host
          argument, the host will be used as default host for future
          transfers.  If localname is specified, the file is stored
          locally as localname, otherwise the original filename is used.
          Note that it is not possible to download two files at a time,
          only one, three, or more than three files, at a time.

Note that second usage form and those last two sentences.

share|improve this answer

Your Answer

 
discard

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