sample lftp command lines?

Rick Stevens rstevens at vitalstream.com
Wed Aug 24 18:33:49 UTC 2005


Harold Hallikainen wrote:
>>Harold Hallikainen wrote:
>>
>>>As I SLOWLY move stuff from an RH8 to an FC4 system, I've found that
>>>ncftp
>>>is not included in FC4, but lftp is included. I have a script that does
>>>a
>>>daily ftp of a tar file to a remote server. I'm having difficulty
>>>figuring
>>>out from the man page on lftp what a command line would look like that
>>>would log me in to the remote server and put the local file in the
>>>appropriate remote directory. Anyone know of some sample lftp command
>>>lines?
>>
>>ncftp comes with FC4.  It's not part of the "default" install
>>configurations, but you can "yum install ncftp" and get it, either from
>>one of the repos on the net or from your DVD or CD collection.
>>
>>lftp isn't that hard to grok.  Just put the commands you want to run in
>>some file somewhere, then launch lftp with the "-f" flag and specify the
>>name of the script file.  Sample script file, "/tmp/lftp.scp":
>>
>>	user remoteusername remoteuserpassword
>>	cd /remote/directory
>>	lcd /local/directory
>>	put name-of-tar-file
>>	exit
>>
>>To run it: "lftp -f /tmp/lftp.scp".
>>
>>
>>>THANKS!
>>>
>>>Harold
>>>ps - I'm CLOSE to getting everything working! I had to modify a buncy of
>>>php stuff to work on the new machine. I've got this ftp problem and some
>>>perl stuff to update, then it might be ready to put on line!
>>
>>To be brutally honest, rsync is more suited to this sort of thing.
>>Using rsync in an ssh tunnel is even better and far more secure to boot.
>>Assuming the data you're copying around is in the same directory or
>>directory tree, rsync would obviate the need to tar it up in the first
>>place.
> 
> 
> IT WORKS! I added open hostname to the top of the script. I appreciate the
> help and the brutal honesty. I am using rsyncbetween my own servers, but
> my ISP does not support anything other than ftp uploads. lftp did it.

Ah, yes, I forgot that bit (sleep deprivation does that to me).  Glad to
hear that you got it working.  Also keep in mind that lftp's default
transfer mode is binary (or "image").  If you upload or download a text
file, make sure you add the "-a" option to the "put" or "get" commands:

	put -a name-of-file

to force ASCII (text) mode.  There is no global "mode" command (e.g.
"binary" or "image" or "text" or "ascii") as there is in conventional
FTP clients.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-            I'm afraid my karma just ran over your dogma            -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list