Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP on SCO Unix Ver 3.2.4.2

Status
Not open for further replies.

salimwng

IS-IT--Management
Mar 11, 2002
134
MU
I have got sco tcp/ip installed on my sco Unix Ver 3.2.4.2. While ftp from another sco Unix server of same version, it transfers only one file per time. I tried get command, but this one can copy group of files, which is still not appropriate. Am looking for a good command or program which can copy directories and sub directories contents, by keeping the same permissions on target.

Is this possible ?

Thank you
Salim
 
I'm really not sure what you are asking: doesn't

prompt off
mget *

do what you want? If not, maybe this will help:

How can I automate an ftp transfer?

There are actually numerous ways to do that. If your script is complex, I'd use Kermit.

* *
You can also use "here" files:

HOST=xxx
FTPUSER=xxx
FTPPASSWORD=xxx
ftp -n $HOST <<-EOF
user $FTPUSER $FTPPASSWORD
cd /wherever
bin
prompt off
mget '*'
bye
EOF


Finally, ftp already has a scripting language built in to it. &quot;ncftp&quot; (available from Skunkware) has even more capability, but here's a basic .netrc (see man netrc) for normal ftp.

----$HOME/.netrc 600 perms --
machine somewhere.com login mylogin password mypass macdef
init
lcd /appl/fp/merge
cd /appx/data/50/XFR/Data
put artrx.tab TRXFER.dat
quit

machine someothermachine.org login whatever password pass macdef
init
hash
bin
prompt off

machine yetanother ...


The first example (somewhere.com) logs in, changes to a local directory /appl/fp/merge, then changes to /appx/data/50/XFR/Data on the server and &quot;puts&quot; a file.

With this in place, the command &quot;ftp somewhere.com&quot; will do the &quot;put&quot;. You could set &quot;prompt off&quot; and use &quot;mput&quot; or &quot;mget&quot; in the .netrc also.

The second just logs you in to &quot;someothermachine.org&quot; , turns on hash, etc. and then you can type your own commands.

You can fully script more complex things with:

#!/bin/ksh
echo &quot;machine somewhere.com login mylogin password mypass
macdef init&quot; > $HOME/.netrc
echo &quot;lcd /appl/fp/merge&quot; >> $HOME/.netrc
echo &quot;cd /appx/data/50/XFR/Data&quot; >> $HOME/.netrc
for i in *.tab
do
echo &quot;put $i ${i%tab}.dat&quot; >> $HOME/.netrc
done
echo &quot;quit&quot; >> $HOME/.netrc
echo &quot; &quot; >> $HOME/.netrc
# always end a macdef with a blank line
chmod 600 $HOME/.netrc
ftp somewhere.com


Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top