1819805 Members
3250 Online
109607 Solutions
New Discussion юеВ

mget in FTP

 
SOLVED
Go to solution
Paul Booth (IAD)
Occasional Advisor

mget in FTP

Trying to ftp a number of files using the mget command.

ftp> mget *.rtf

After pressing enter I get the following error:
"Arguments too long".

All of the files I'm trying to FTP are similar to the one below:

009891_claim_391_20011012_094452.rtf

How can I resolve this error.
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: mget in FTP

Hi:

Your fundamental problem is that *.rtf is returning more entries than the buffer space for filenames allows. The limit varies from implementation to implementation but you've hit it.

You should be able to mget a subset of those with mget 0*.rtf, mget 1*.rtf ...

Clay
If it ain't broke, I can fix that.
Ravi_8
Honored Contributor

Re: mget in FTP

Hi,

doubt here is the length of line name, first you try mget as said by clay, if you couldn't then move the file to a shorter name and do mget
never give up
Ravi_8
Honored Contributor

Re: mget in FTP

Hi,

doubt here is the length of file name, first you try mget as said by clay, if you couldn't then move the file to a shorter name and do mget
never give up
John Bolene
Honored Contributor
Solution

Re: mget in FTP

You can also tar all those files up and then ftp the tarball.

Some commands have numbers of files limits, such as rm.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Wodisch
Honored Contributor

Re: mget in FTP

Hello,

can you get the list of files?
Then you could create a local "$HOME/.netrc" file, which would contain something like this:

machine THATSERVER login YOURNAME password YOURPASSWORD macdef init
cd /SOURCEDIR
lcd /TARGETDIR
bin
get file1
get file2
get file2
.
.
.
quit

and you would copy in all the filenames (one by one) into that textfile, each line starting with "get ".
Make the permissions like 600 or 400, and then start you "ftp THATSERVER" and watch everything being transfered...

HTH,
Wodisch
PS: Do not forget to delete that file afterwards for security reasons (contains a password).
Sridhar Bhaskarla
Honored Contributor

Re: mget in FTP

It think it is the *number* of files that mget is trying to get. How many of them are there?. As suggested by others, you need to break them into subsets.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try