Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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)
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.
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.