Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Networking
author message
FTP. TFTP, and REXX
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
dljone9
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 93
since: 13 Jan, 2003
1. FTP. TFTP, and REXX
Reply to this topic with quote Modify your message
I work for a fairly large coproration that has more than several hundred OS/2 servers in the field. I want to deploy a REXX script that uses FTP or TFTP to copy a file from a certain subdirectory on every server - to a server in our lab. I am not real astute with REXX, but I do have folks who I can work who may help. I just need to get the basic syntax down, as follows:

d:
cd (directory with files)
rename (filename) (newfilename)
tftp connect (tftp host) userid password
put (filename)
quit

I can set up the server real easy - I just need some coaching on
the REXX syntax for scripting FTP and TFTP transfers.

Much obliged for any help you may offer...

Daniel

Date: 20 Aug, 2004 on 18:35
TimC
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 11
since: 21 Feb, 2003
2. Re:FTP. TFTP, and REXX
Reply to this topic with quote Modify your message

dljone9 (20 Aug, 2004 18:35):
I work for a fairly large coproration that has more than several hundred OS/2 servers in the field. I want to deploy a REXX script that uses FTP or TFTP to copy a file from a certain subdirectory on every server - to a server in our lab. I am not real astute with REXX, but I do have folks who I can work who may help. I just need to get the basic syntax down, as follows:

d:
cd (directory with files)
rename (filename) (newfilename)
tftp connect (tftp host) userid password
put (filename)
quit

I can set up the server real easy - I just need some coaching on
the REXX syntax for scripting FTP and TFTP transfers.

Much obliged for any help you may offer...

Daniel


Try this:


/* REXX */

Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
Call SysLoadFuncs

Call RxFuncAdd 'FtpLoadFuncs','rxFtp','FtpLoadFuncs'
Call FtpLoadFuncs

host_Name = '_______' <=== recipient ftp server
UID = '______' <=== sender's userid on ftp server
PSWD = '_______' <=== sender's password on ftp server

rc = FtpSetUser(host_Name,UID,PSWD)
Say 'FtpSetUser rc ='rc

HostOS = FtpSys(HostOS)
Say 'FtpSys rc ='rc
Say 'HostOS ='HostOS

rc = FtpPut("d:\text.tmp","text.tmpa)","ASCII") <=== for example
Say 'FtpPut (A) rc ='rc
rc = FtpPut("d:\text.tmp","text.tmpb)","ASCII") <=== and again
Say 'FtpPut (B) rc ='rc

rc = FtpLogoff()
Say 'FtpLogoff rc ='rc

Return
/* ----------------------------------------------------------- */


The Say commands are just simple documentation, of course. Also,
if you don't want to show the userid and/or password in this Rexx
exec, look into the use of a NETRC file.

For much more info, see the RXFTP.INF and RXSOCKET.INF help files.

---
Tim H Cardozo
OS/2 SIG of the Sacramento PC Users Group
SIG Leader

Date: 21 Aug, 2004 on 02:06
dljone9
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 93
since: 13 Jan, 2003
3. Re:FTP. TFTP, and REXX
Reply to this topic with quote Modify your message
Thanks a million - will try this on Monday...

You rock!

Date: 21 Aug, 2004 on 04:45
FTP. TFTP, and REXX
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com 2000-2004