Reputation: 12216
I have a long running, compute and disk intensive task that needs to run nightly on Window Server 2008; my Framework of choice is .NET 3.5 sp1. There's a chance this task could fail too for any number of reasons (i.e. lack of disk space) and I'd like to make sure errors are handled & reported reasonably. Also, this task would require permission to do things like create a database connection and read/write to the file system. What options are available for getting things like this done?
Edit: My question is more about whether to use windows schedule or some other mechanism to kick off the process.
Upvotes: 0
Views: 339
Reputation: 3829
Two words ... exception handling
One other word ... logging
In addition to all the other very sound advice offered by the others here, if this is to be a long running process to run unattended, I would pay extra attention to how you handle exceptions and how you log/report them so that you know if something went wrong and have enough information to correct the issue.
Upvotes: 1
Reputation: 7426
Create a Console Application. Inside the main() method, put a try-catch, and use SmtpClient to send notifications about unhandled exceptions. Compile it and add an entry to run it using the Scheduled Task applet.
Upvotes: 2
Reputation: 37819
This sounds like it's just a standard console application that needs to run on a set scheduled (Windows Scheduled Tasks) and needs simple logging/reporting and communication capabilities and probably some linq2sql for db crud operations.
Frankly, at this point, it sounds like your options are wide open.
Upvotes: 1
Reputation: 15069
Code it.... What is the question ? Create a good solid code that handles everything and you'll have your task. you can make a service out of it, and ask windows to restart if fails, or just wrap it in an infinate loop with try / catch all but take care of things that if not fixed won't worth continue....
Upvotes: 0
Reputation: 33141
Do you have more specific questions? All of this is totally doable. You can catch and log exceptions in a log file, and mail those results using SMTP. You can also make connections to a database which is very simple. Is there one single thing that you are having problems with that we could help?
You can use the windows scheduler to set this app up as say a job to run at a specific time or duration, etc.
Upvotes: 0