3

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?

Gareth
  • 19,080

3 Answers3

2

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

Jason
  • 21
1

Have you tried:

tftp 173.32.52.12 <<!
   get MyFile1.txt
   get MyFile2.txt
!
0

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.

Spiff
  • 110,156