Add logging of raw PSFTP output for missing file
detections. Changed error parsing to be based on 'ftpadmin' rather than 'ssh_init'
This commit is contained in:
committed by
Mitchem Dakota (CSC FI SPS MESLEO External)
parent
f8c83dd7f4
commit
d32b4b6e82
@ -838,7 +838,8 @@ Service ListDirectory(Host=HOSTS, Username, Password, RemoteDirectory, Query, Sc
|
||||
Command = 'ftp -i -n -s:' : ScriptPath
|
||||
end
|
||||
DirectoryList = SRP_Run_Command(Command, 'VAR')
|
||||
If Count(DirectoryList, 'ssh_init') EQ 0 then
|
||||
|
||||
If Count(DirectoryList, 'ftpadmin') NE 0 then
|
||||
Gosub LsToMls
|
||||
end else
|
||||
Error_Services('Add', DirectoryList)
|
||||
@ -903,3 +904,4 @@ return
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -38,8 +38,8 @@ LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\CO
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_Error' '.log'
|
||||
Headers = 'Logging DTM' : @FM : 'Shipment ID' : @FM : 'Expected Remote Directory' :@FM: 'Customer/COMPANY Number'
|
||||
ColumnWidths = 30 : @FM : 20 : @FM : 50 :@FM: 50
|
||||
Headers = 'Logging DTM' : @FM : 'Shipment ID' : @FM : 'Expected Remote Directory' :@FM: 'Customer/COMPANY Number' :@FM: 'Error Output'
|
||||
ColumnWidths = 30 : @FM : 20 : @FM : 50 :@FM: 50 :@FM: 300
|
||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
@ -68,7 +68,6 @@ Service CycleRetentionDates()
|
||||
CycleRec = Xlate('APP_INFO', 'COC_AVAILABILITY', '', 'X')
|
||||
TodayDate = Date()
|
||||
EarliestDate = Shipment_Services('GetEarliestDate')
|
||||
|
||||
If CycleRec<1> EQ TodayDate then
|
||||
CurrStartDate = CycleRec<2>
|
||||
CurrEndDate = CycleRec<3>
|
||||
@ -100,7 +99,6 @@ Service CycleRetentionDates()
|
||||
EndDate = TodayDate
|
||||
NewRec = ''
|
||||
NewRec<1> = TodayDate
|
||||
|
||||
NewRec<2> = StartDate
|
||||
NewRec<3> = EndDate
|
||||
Database_Services('WriteDataRow', 'APP_INFO', 'COC_AVAILABILITY', NewRec, True$, False$, False$)
|
||||
@ -154,15 +152,19 @@ Service CheckFileAvailability(StartDate, EndDate)
|
||||
DeleteScript = True$
|
||||
Query = '*' : COCNo : '*'
|
||||
QueryResult = FTP_Services('ListDirectory', FTPHost, Username, Password, RemoteDirectory, Query, '', DeleteScript, SSH, '')
|
||||
If Count(QueryResult, 'ssh_init') EQ 0 then
|
||||
If QueryResult EQ '' then
|
||||
Error_Services('Add', 'Expected file for shipment ' : COCNo : ' missing.')
|
||||
NewCOC<COC_FTP_EXISTS$> = False$
|
||||
Gosub LogMissingFile
|
||||
end else
|
||||
ErrTest = Error_Services('GetMessage')
|
||||
If ErrTest EQ '' then
|
||||
If QueryResult NE '' then
|
||||
NewCOC<COC_FTP_EXISTS$> = True$
|
||||
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
||||
end
|
||||
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
||||
end else
|
||||
If Count(ErrTest, 'ssh_init') EQ 0 then
|
||||
Error_Services('Add', 'Expected file for shipment ' : COCNo : ' missing.')
|
||||
NewCOC<COC_FTP_EXISTS$> = False$
|
||||
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
||||
Gosub LogMissingFile
|
||||
End
|
||||
end
|
||||
end
|
||||
END
|
||||
@ -290,6 +292,7 @@ LogMissingFile:
|
||||
LogData<2> = COCNo
|
||||
LogData<3> = RemoteDirectory
|
||||
LogData<4> = CustNo
|
||||
LogData<5> = ErrTest
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||
|
||||
return
|
||||
@ -340,3 +343,4 @@ return
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user