Q: I’m looking for a way to monitor if a file doesn’t make I to a directory. The filename of the files have the date in it. “Importer_WXII_mm-dd-yyyy-#0.xml”. example for today would be “Importer_WXII_01-09-2024-#.xml” The date in the filename will not match the modified or created time stamp of the file. I’m looking for a way to monitor the directory send a failure email if the file name is not present within a certain time span of the date. Example would be
If “Importer_WXII_01-11-2024-#0.xml” file exists and the current computer date is 01-10-2024 then nothing happens the file needed exists so no issues. On the other hand.
If “Importer_WXII_01-11-2024-#0.xml” file does not exist and the current computer date is 01-10-2024 and its 12hours before 01-11-2024 then email is sent.
A: We did a test and added the following screenshots to get you started.
- We used a Windows folder as Source:
- We added the following Filename Include Filter. This filter will check if the xml you need is available.
- Important, do not forget to enable ‘Allow parameters in File Name Filter’:
- Set Function to Copy, don’t worry we are not going to do anything with the xml files.
- We added a dummy ‘Pascal Script’ as Destination:
Begin psExitCode:= 1; // ... add your code here psLogWrite(1, '', 'We found file: ' + psFilePath + psFileName); End.
- Next, Rule Events setup:
- Select and enable the ‘On No File Found’ event. We are going to send an email when the xml file is not available.
- Enable and setup ‘Mail Event’:
- Enable and setup ‘Pascal Script’. This will add some info into the log window.
Begin psExitCode:= 1; // ... add your code here psLogWrite(1, '', 'xml file not available'); End.
- Schedule setup:
- Disable Timer:
- Add a Schedule when you would like to check for this xml file.
- You can add multiple Schedules if you want.
#managedfiletransfer #filetransfer #filemanagement
If you need any help with this ‘monitor if a file doesn’t make it to a directory’ question, please let us know.
Best Regards,
Limagito Team