How to halt moving too many files and send an alert
Q: I have a job that moves files from an external S3 bucket into our local storage. The other day a vendor hiccupped and sent 8000 files. Limagito did it’s job and moved them over, which ended up gumming up our systems. Is there any way to limit transfers? I’ve been looking through Help and haven’t seen anything yet.
For instance…I know this vendor normally sends around 10 a month. Anything over 50 would obviously be abnormal and It would be great to throttle them, even better to send an alert and let us know, so we can correct the issue.
Any help would be greatly appreciated.
A: Please have a look at the following setup. So we’ll allow only a maximum of files per month.
- We used a Windows folder as Source:
– Function Setup > set Destination Options to ‘Destination Memory & Exit Cyclus on Error’
– Destination Setup:
- First Destination: Pascal Script
- This script will check the month and the amount of files it successfully moved
- You can adjust the “ctMaxFilesAllowed” Const value to allow more or less files per month
- Second Destination: your output, can be any Destination type.
- Third Destination: Pascal Script
- Will increase the internal counter (VIA) if a file is successfully moved
Link to both scripts, for the first and third Destination.
First Destination (Pascal Script):
Third Destination (Pascal Script):
– Open Our Rule Events option:
– Select and enable ‘On Pascal Script Error’ event. Enable ‘Enable Mail’ and adjust the mail setup. There is a test button available.
Enable the ‘Error event memory’ because otherwise you’ll get too many emails in case the maximum of files is reached.
FYI: When you would test this setup and max files are reached we added a way to reset the internal counter (max files allowed per month).
Right click on the Counter value below and select ‘Reset Counter’.
This is is just an example of what is possible. If you need any help with this ‘halt moving too many files’ setup, please let us know.
Best Regards,
Limagito Team
#managedfiletransfer #filetransfer #filemanagement