LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 08-07-2008, 03:08 PM   #1
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Rep: Reputation: 15
"sorry, input line too long" error using ftp


Greetings!

For once, Google has failed me. We have a process that parses through a list of recently changed files, then assembles them as ftp commands in a shell script and executes the shell script. However, the file names have been getting longer and longer to the point where my command is over 200 characters long, resulting in errors such as: "sorry, input line too long" when issuing the put command (put /path/to/file/localfile /path/to/file/remotefile) Since these files are kept throughout various directories, I hate to issue a change directory command for every put option.

Is this an FTP issue? A Linux issue? A Windows issue? (The destination server is a Windows FTP server, but its logs don't even show an attempt to STOR the file).

My ftp client is ftp-0.17-17.2 (which is the most current one Red Hat offers) running RHEL 3.

Thanks in advance for your help.

--Ziggie
 
Old 08-07-2008, 04:08 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
I've only seen these issues with Windows. What version of Windows? I know 2000 had a shorter line length limit than XP does. I don't think it lies within Linux or you're FTP client.
 
Old 08-07-2008, 04:28 PM   #3
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
that error message comes from the ftp client. From netkit-ftp source code:

~/netkit-ftp-0.17$ grep -n "input line too long" ftp/main.c
327: printf("sorry, input line too long\n");

try another ftp client, perhaps, or if you're trying to synchronize files try something like rsync.
 
Old 08-07-2008, 05:04 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by grepmasterd View Post
that error message comes from the ftp client. From netkit-ftp source code:

~/netkit-ftp-0.17$ grep -n "input line too long" ftp/main.c
327: printf("sorry, input line too long\n");

try another ftp client, perhaps, or if you're trying to synchronize files try something like rsync.
Actually you're right, checked the source from a RHEL SRC RPM for ftp, has same code and tested myself. You either need to find a new client and or cd into the directory to then transfer the file. I wouldn't mess with setting up an rsync server on a windows server.
 
Old 08-08-2008, 10:39 AM   #5
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Original Poster
Rep: Reputation: 15
my, aren't you guys full of good news.

any recommended RHEL compatible FTP command line clients that are ideal for batch processing?

and since I don't control the destination server, rsync is not an option (although, I wonder if there is a way to mount an FTP session as a local drive....LoL)
 
Old 08-08-2008, 01:31 PM   #6
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
well, you're hitting a "corner-case" limit in the netkit ftp client, so other clients could have other arbitrary limits that won't be apparent until you run into them. with that caveat in mind, I'd try ncftpbatch.
 
Old 08-08-2008, 02:24 PM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
And like mentioned before, Windows (depending on version) itself could also have a limitation of the input line as well as I've seen, so changing ftp clients might not resolve the actual problem.
 
Old 08-08-2008, 02:44 PM   #8
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
not likely. a good ftp client (like the ncftp family of clients) will parse the user input into RFC compliant (read "legal") FTP commands, so the server won't know the difference between the batched vs. typed user input. And even on the server side, the FTP behavior is not a windows issue, it's an issue with the particular FTP server application being used.

I'm unsure if there is a specific limit on string length in the FTP protocol, however, so be aware of that too. You are generally at risk of failure at some point when using such long strings, since most software imposes limits on data lengths to prevent buffer overflow attacks and such (which is a good thing).
 
Old 09-22-2008, 12:18 PM   #9
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Original Poster
Rep: Reputation: 15
For what it's worth, lftp worked just fine for me. It was a simple modification to use it instead of the standard ftp client.

Thanks for all your help!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 5 = Input/output error" but smbfs works! humbletech99 Linux - Networking 36 12-18-2019 02:59 AM
C++ input file reading "line by line" assamite Programming 2 05-31-2008 04:54 PM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 08:35 AM
How to convert "unsigned long long" to "char pointer"? novicehacker Linux - Kernel 1 11-20-2006 12:57 AM
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 04:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration