Sending Text File That Contains Notes Documents to a Host That Has Notes on Unix

Instead of doing a manual FTP each time it's required, here is a scheduled agent that runs everyday and FTPs a text file to a Notes server at another location that has Unix as the O.S. I have used a batch file which is created in Notes and which actually accesses the destination server & exports the text file there. The batch file and the text file are assumed to reside in the same directory.


'CONSTANTS
'IP address of the destn host
Const gFTPDestnHost$ = "xxx.xxx.xx.x"
'UserID required to log on at the destn
Const gUserID$ = "UserID"
'Password required to log on at the destn
Const gPassword$ = "password"
'Name of the file to be exported.
Const ExportFileName$ = "ExportFile.txt"
'Path where the text file resides
'Const gSourceFilePath$ = "/xx/yy"
'FTP executable
'Const gFTPProgram$ = "ftp"

Sub Initialize
'Declarations
Dim FTPBatchFileNum As Integer
Dim FTPBatchFileName As String
Dim TaskID As Integer

'Creating a batch file that contains all the FTP commands to FTP the "ExportFile.txt" to the destination server whose host name is indicated in the constant gFTPDestnHost$ above
FTPBatchFilenum% = Freefile()
FTPBatchFilename$ = gSourceFilePath$ & "/" &
"FTP.bat"
Open FTBatchFileName$ For Output As
FTPBatchFileNum%

'Writing FTP commands to the batch file
Print #FTPBatchFileNum% "open" & " " &
gFTPDestnHost$
Print #FTPBatchFileNum% "user" & " " &
gUserID$ & " " & gPassword$
Print #FTPBatchFileNum% "put" & " " &
gSourceFilePath$ & "/" & gExportFileName$
Print #FTPBatchFileNum% "bye"
Close #FTPBatchFileNum%

'Shell command used to execute the FTP commands in the FTPBatchFileName$ created above.
TaskID% = Shell(gFTPProgram$ & " -I -v -n < "
& FTPBatchFileName$ , 6)

Exit Sub

This was first published in November 2000

Dig deeper on Domino Resources - Part 7

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close