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
Start the conversation
0 comments