[Cialug] lftp vs ncftp

David Champion dchampion at visionary.com
Fri Oct 17 09:43:25 CDT 2008


I think this is the winner... I tried the -e 'put ...' method that Barry 
and Dave mentioned, but the problem with that is it doesn't disconnect 
when the transfer is done.

So, Tom's incantation with "; exit" tacked on the end does the trick.

-dc

Tom Pohl wrote:
> I always do it like this:
>
> lftp -c "open remotehost ; user myuser mypass ; put filename"
>
> You can basically put commands separated by ';'s as if you were 
> playing with it interactively.
>
> -Tom
>
> On Oct 16, 2008, at 7:51 PM, Dave Crouse wrote:
>
>> You need to put the command in "quotes" I think.......
>> Something like
>>
>> lftp -u username,password -e "mirror --delete --only-newer --verbose
>> path/to/source_directory path/to/target_directory" ftpsite
>>
>>
>> I think your just missing the quotes.
>>
>>
>> Dave Crouse
>>
>>
>>
>>
>> On Thu, Oct 16, 2008 at 6:20 PM, David Champion 
>> <dchampion at visionary.com> wrote:
>>> I'm used to using ncftp, trying to switch over to using lftp on RH / 
>>> Centos
>>> machines where ncftp isn't always available.
>>>
>>> Here's an example of a one-liner in ncftp:
>>>
>>> ncftpput -F -u myusername -p mypassword ftp.myhostname.com
>>> /remote/destination/path  /local/path/filename.txt
>>>
>>> I'm trying to do something similar in lftp, but it looks to me like 
>>> you have
>>> to use a 2nd script to run a simple put command, and call the script 
>>> with:
>>>
>>> lftp -u myusername,mypassword ftp.myhostname.com -F myscript.lftp
>>>
>>> Where myscript.lftp say:
>>>
>>> cd /remote/destination/path
>>> put /local/path/filename.txt
>>>
>>> Does anyone know of a better what to do this? I tried doing 
>>> something like
>>> this:
>>>
>>> lftp -u username,password -e put filename.txt ftp.myhostname.com
>>>
>>> From reading the man page, it looks like that should work, but it 
>>> doesn't...
>>> gives the error:
>>>  Try `help put' for more information
>>>
>>> -dc




More information about the Cialug mailing list