-
filesystemwatcher
Hi,
I have created a windows service which monitors the activities of files on the server. This windows service is using a filesystemwatcher.
Every time there is an activity, i.e. when a file is moved or created, etc., then the system sends an email.
All works fine.
Question:
Imagine something will have to get installed on the server and the user forgot to turn off this windows service. Then as a result, a lot of emails will get sent.
This is what I am trying to avoid (Sending un-necessary emails).
Ideally, the user will turn this windows service off but what if he doesn't? certainly we do not what the system to send so many emails as the result of something being installed which can cause alot of files movements and creations, etc...
Thanks
-
Re: filesystemwatcher
Well as far as I can see it (and I might be wrong), there is no possible way that your service could just magically know that something is being installed instead of something just being moved or deleted etc... There would HAVE to be some kind of user interaction to say 'Im installing something now so dont send emails' but then thats just the same as them having to go and turn off the service really.
The only thing I can think of to get around this kind of thing would be to make your filesystemwatcher send a report every 20 minutes or something (but obviously only IF it has anything to report) and in this email report you would list all of the files that had been changed. Most installations dont take longer than 20 mins so you would only get one email when someone installed something and it would list all of the changed files. So what I mean is, when your filesystemwatcher detects a change, it starts a timer and starts to keep track of any further files that are changed, then after 20 minutes or whatever it sends an email. Obviously this wouldnt be any use if you needed to be notified instantly of any changed files on the server but I would imagine 15 - 20 mins latency wouldnt make much difference?
Maybe someone else has a better suggestion but that's my thoughts :)