Web Jobs Scheduler

Web Job Scheduler

This work is based on the Web Based Job Scheduler by Igor Krupitsky
you can find it on The Code Project

You can download my version here JobScheduler.zip.

The software is a little rough around the edges and there are hardly any
comments in the code, but it is working very nicely in a production environment
for us (Netz Internet Solutions). It is written in VB.NET and much of the code
was generated by a wizard.

[From the codeproject.com page]

This application has three components:
	* A Windows Service that will run a job (DOS command text)
	* A Web Application that will let you schedule a job
	* MS SQL Server database stored procedure to get the lists jobs 
	that need to run.

[There is a lot more info on the codeproject page, read it!]

These are my additions to the software:
	1. The WinJobService work in multi-thread mode. Every task starts as a
	separate thread. The service monitors it for 24 hours and not just 10
	seconds, and of course, different tasks can run at the same time. However
	the service will not start the same task twice.
	2. There is an option to kill a running task from the web interface. The
	WinJobService polls the database every 10 seconds, and kill the task if it
	needs to. There is also an option to Disable/Enable a job.
	3. I think it is a security risk to let a web user run *any* program on the
	server. If the web page will be seen by the wrong person it might be a
	disaster! I'm running only Python scripts, and they all in one folder.
	I set the WinJobService to always run python.exe, always in the same folder,
	and the user just supply the script name. Moreover the service will only run
	scripts (file names ending with .py). All these parameters are configured in
	an XML file, so a user can use any base program, any working directory, and
	limit the executed command by a regular expression.
	4. I use MySql database and translated the T-SQL scripts to build it.
	5. The database connection cardinals are set in XML file for the Windows
	Service and in the Web.config file for the website. Igor uses UDL file for
	that. there is no "better" option here.

Steps to deploy my version:
	1. Connect to your SQLServer/MySql.
	2. Set your password in JobScheduler[_MySql].sql and run it on the server.
	3. Run ScheduleSchema[_MySql].sql
	4. Run GetJobsToRun[_MySql].sql
	5. Copy WebScheduler folder to your IIS web server.
	6. Copy WinJobService folder to your programs folder.
	7. Instead of setting the UDL files, in WinJobService/bin change
	Conf.xml.example to Conf.xml and set your data. In WebScheduler change
	Web.config.example to Web.config and set the database connection data.
	8. If you use SqlServer and not MySql you MUST change and recompile the
	application. Open WinJobService (WinJobService\WinJobService.sln) project in
	Microsoft Visual Studio .NET 2003 (I use Sharp Develop). In JobScheduler.vb
	Line 39 comment the MySql connection string and uncomment the Sqlserver
	connection string. Compile the project.
	9. Do the same for the website code. Open WebScheduler\WebScheduler.sln,
	change Helper.vb Line 35 and compile the project.
	[Igor wrote]
	10. Register the server by running Service registration script:
	WinJobService\bin\Install.vbs. You can later uninstall the service by
	running Uninstall.vbs.
	[But I did]
	10. Run from command prompt:
	> cd C:\WINDOWS\Microsoft.NET\Framework\
	> InstallUtil ...\JobScheduler\WinJobService\bin\JobScheduler.exe
	(enter full path to JobScheduler.exe)
	Then go to Services management and set "Job Secheduler" to run automatic,
	and start it.

	This software is licensed under The GNU Lesser General Public License

	There ware a few requests to port the code to C#. I agree that C# is the way
	to go, and it won't be hard to port the code, but right now I don't have
	time for it and as far as the .NET framework is concerned, I don't think
	there is different between compiled C# code and compiled VB.NET code.

	Buld SQL scripts for Oracle

	Port the website code to PHP

* If you add to this project please send us the code so I can put it on this
page (with credits), or just send me the link to your version web page.

Netz Internet Solutions