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
|
Command = 'ftp -i -n -s:' : ScriptPath
|
||||||
end
|
end
|
||||||
DirectoryList = SRP_Run_Command(Command, 'VAR')
|
DirectoryList = SRP_Run_Command(Command, 'VAR')
|
||||||
If Count(DirectoryList, 'ssh_init') EQ 0 then
|
|
||||||
|
If Count(DirectoryList, 'ftpadmin') NE 0 then
|
||||||
Gosub LsToMls
|
Gosub LsToMls
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', DirectoryList)
|
Error_Services('Add', DirectoryList)
|
||||||
@ -903,3 +904,4 @@ return
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\CO
|
|||||||
LogDate = Oconv(Date(), 'D4/')
|
LogDate = Oconv(Date(), 'D4/')
|
||||||
LogTime = Oconv(Time(), 'MTS')
|
LogTime = Oconv(Time(), 'MTS')
|
||||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_Error' '.log'
|
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'
|
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
|
ColumnWidths = 30 : @FM : 20 : @FM : 50 :@FM: 50 :@FM: 300
|
||||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
|
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
|
||||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||||
|
|
||||||
@ -68,7 +68,6 @@ Service CycleRetentionDates()
|
|||||||
CycleRec = Xlate('APP_INFO', 'COC_AVAILABILITY', '', 'X')
|
CycleRec = Xlate('APP_INFO', 'COC_AVAILABILITY', '', 'X')
|
||||||
TodayDate = Date()
|
TodayDate = Date()
|
||||||
EarliestDate = Shipment_Services('GetEarliestDate')
|
EarliestDate = Shipment_Services('GetEarliestDate')
|
||||||
|
|
||||||
If CycleRec<1> EQ TodayDate then
|
If CycleRec<1> EQ TodayDate then
|
||||||
CurrStartDate = CycleRec<2>
|
CurrStartDate = CycleRec<2>
|
||||||
CurrEndDate = CycleRec<3>
|
CurrEndDate = CycleRec<3>
|
||||||
@ -100,7 +99,6 @@ Service CycleRetentionDates()
|
|||||||
EndDate = TodayDate
|
EndDate = TodayDate
|
||||||
NewRec = ''
|
NewRec = ''
|
||||||
NewRec<1> = TodayDate
|
NewRec<1> = TodayDate
|
||||||
|
|
||||||
NewRec<2> = StartDate
|
NewRec<2> = StartDate
|
||||||
NewRec<3> = EndDate
|
NewRec<3> = EndDate
|
||||||
Database_Services('WriteDataRow', 'APP_INFO', 'COC_AVAILABILITY', NewRec, True$, False$, False$)
|
Database_Services('WriteDataRow', 'APP_INFO', 'COC_AVAILABILITY', NewRec, True$, False$, False$)
|
||||||
@ -154,15 +152,19 @@ Service CheckFileAvailability(StartDate, EndDate)
|
|||||||
DeleteScript = True$
|
DeleteScript = True$
|
||||||
Query = '*' : COCNo : '*'
|
Query = '*' : COCNo : '*'
|
||||||
QueryResult = FTP_Services('ListDirectory', FTPHost, Username, Password, RemoteDirectory, Query, '', DeleteScript, SSH, '')
|
QueryResult = FTP_Services('ListDirectory', FTPHost, Username, Password, RemoteDirectory, Query, '', DeleteScript, SSH, '')
|
||||||
If Count(QueryResult, 'ssh_init') EQ 0 then
|
ErrTest = Error_Services('GetMessage')
|
||||||
If QueryResult EQ '' then
|
If ErrTest EQ '' then
|
||||||
|
If QueryResult NE '' then
|
||||||
|
NewCOC<COC_FTP_EXISTS$> = True$
|
||||||
|
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
If Count(ErrTest, 'ssh_init') EQ 0 then
|
||||||
Error_Services('Add', 'Expected file for shipment ' : COCNo : ' missing.')
|
Error_Services('Add', 'Expected file for shipment ' : COCNo : ' missing.')
|
||||||
NewCOC<COC_FTP_EXISTS$> = False$
|
NewCOC<COC_FTP_EXISTS$> = False$
|
||||||
Gosub LogMissingFile
|
|
||||||
end else
|
|
||||||
NewCOC<COC_FTP_EXISTS$> = True$
|
|
||||||
end
|
|
||||||
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
||||||
|
Gosub LogMissingFile
|
||||||
|
End
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
END
|
END
|
||||||
@ -290,6 +292,7 @@ LogMissingFile:
|
|||||||
LogData<2> = COCNo
|
LogData<2> = COCNo
|
||||||
LogData<3> = RemoteDirectory
|
LogData<3> = RemoteDirectory
|
||||||
LogData<4> = CustNo
|
LogData<4> = CustNo
|
||||||
|
LogData<5> = ErrTest
|
||||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -340,3 +343,4 @@ return
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user