Scheduled Batch Jobs

Scheduled Batch Jobs

Old forum URL: forums.lhotka.net/forums/t/11398.aspx


pondosinat posted on Wednesday, June 06, 2012

I'm putting together a Windows service for a client that will run scheduled batch jobs (sending out emails, archiving data, etc..) and was wondering what a typical solution might be for this? I wrote a couple services based on the CSLA BatchQueue a long while back, and was considering using it again since it's fairly lightweight, even though it was dropped from the CSLA framework years ago.

I noticed Rocky mentioned PowerShell or WF as newer possibilities for this scenario. Has anyone implemented something like that? The main requirements are that the batch jobs need to execute C# code and run on a Windows server. A full-fledged WF host might be overkill, but if it's not too painful to set up/configure I'll go that route.

Thanks,

Brian

JonnyBee replied on Wednesday, June 06, 2012

Why would you write a Windows Service for a scheduled task/ batch job?

Windows /Vista/7/8/Server2008/Server2012) has a building Task Scheduler:
http://technet.microsoft.com/en-us/library/cc721871.aspx

And if you need a managed solution with separate database for logging and configuration look at Autorun:
http://autorun.codeplex.com

pondosinat replied on Wednesday, June 06, 2012

The last time I was working on a solution for scheduling tasks was pre-Windows 7, hence the my ignorance about the built-in Task Scheduler.

Autorun looks like the right way to go and will save a lot of time with it's built in Windows app. Thanks for the great tip!

GaryG replied on Thursday, June 07, 2012

I had pretty good luck a couple of years ago, using an open source Enterprise Job Scheduler called Quartz.Net (a port to .Net of a Java tool).

http://quartznet.sourceforge.net/

We created a central web service to which jobs were submitted. Remote websites would then "phone home" to the service to see if any jobs had been submitted (submitted jobs were specific as to the server they were to run on). If any jobs were scheduled to be run for the server phoning in, those jobs were downloaded and run. A "job" can be anything you define in code.

Might be overkill for your needs, but it worked, and was pretty easy to get up and running.


pondosinat replied on Thursday, June 07, 2012

Thanks for the idea, GaryG. That sounds like a cool way to load balance jobs across multiple servers. For our purposes, it's probably overkill at least for now.

Thanks again.

Copyright (c) Marimer LLC