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!

unix to nt FTP SCRIPT

Status
Not open for further replies.

ra5467

Technical User
Jan 29, 2002
2
US
anyone know of a good script to accomplish a unix to nt ftp session? i have tried some stuff that i found on here for the default ftp client, but it's not working. also, i have looked into kermit (6.0 is installed) but it's not even being allowed to connect to the nt box (even with tcp/ip as the default protocol). the only thing that will connect manually is the normal ftp client built into unix.

help. thx
 
Well, ftp itself can be scripted with a .netrc file. I have an example of that at
I've used shell scripts to create .netrc files (don't forget to chmod 600 it) and then simply run ftp ntbox to execute the commands. Easier than writing expect (although that and perl and even ksh pipes are other ways to do this)

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
if you don't want .netrc try this in a script,

ftp -n -v 55.5.5.55 <<EOF
user tiger scott
cd data
put file.dat file1.dat
quit

EOF

I agree expect may be overkill for ftp but perls net:telnet is pretty slick
 
Cron FTP Script
faq80-965

#CRON ftp Script
#
cd /path/to/directory
ftp -inv <<!
open 192.168.1.23 #Ip address of remote host
user login password
bin
mget * #mget * get all files in directory
quit


-Danny
techie@snoboarder.net






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top