Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: Gary Barnett on February 21, 2002, 04:03:42 AM

Title: Copy file between hosts
Post by: Gary Barnett on February 21, 2002, 04:03:42 AM
What's the best way (from within a script) to copy a file from e-smith to another unix host and vice versa.  Both machines are on the same physical subnet.  I am use to using rcp, but that cmd does not seem to be available on e-smith.  Can ftp be used within a script?  I have never done that.

Thanks for your input.

Gary
Title: Re: Copy file between hosts
Post by: laurent glesner on February 21, 2002, 10:25:12 AM
hi,

i have the same problem and i resolve it with ftp : i have created this script :

ftp <<**
open _another_server_ip_adress_          
cd _directory_on_another_server_         (// remote)
ld  _directory_of_your_file_                   (// local)
binary
put _your_file_name_
exit
Title: Re: Copy file between hosts
Post by: Gary Barnett on February 22, 2002, 06:05:06 AM
Hi Laurent,

Thanks for your prompt help.  I will give this a try.  I have never invoked ftp that way.  Won't this necessarily expose the account password in clear text in the script?  I guess there is no way to avoid that--just make sure the script is not readable by others, right.

Gary
Title: Re: Copy file between hosts
Post by: Des Dougan on February 22, 2002, 08:25:25 AM
Use scp (the secure copy cousin of ssh). Install the man pages from the CD and do "man scp".


Des Dougan
Title: Re: Copy file between hosts
Post by: Gary Barnett on February 22, 2002, 08:52:34 AM
Hi Des,

Great suggestion.  Thanks.  I tried it and get a "Connection refused" msg.  I don't know much about ssh.  The other host is not an e-smith machine, not even Linux.  It's SCO OpenServer5 and it's 2 or 3 years old.  It may require more software/configuration on the SCO box before this will work.  Any thoughts.

Gary
Title: Re: Copy file between hosts
Post by: David on February 22, 2002, 07:17:26 PM
Gary

If its something you don't want to automate, ie. just do it occasionally then use midnight commander's ftp interface.

It is very simple to use and it allows you copy subdirs as well.

Hope this helps

David.
Title: Re: Copy file between hosts
Post by: Gary Barnett on February 22, 2002, 09:35:57 PM
Hi David,

Thanks for your input.  I will certainly look into midnight commander.  Looks like it might have lots of uses.  Regarding my original post, yes it is something I want to automate.  I would expect to run it out of cron on a regular basis.

e-smith and the e-smith community rocks.

Gary