sample lftp command lines?

Rick Stevens rstevens at vitalstream.com
Mon Aug 22 17:55:25 UTC 2005


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.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-  The problem with being poor is that it takes up all of your time  -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list