In PHP we have cron jobs, where the hosting server automatically picks up and executes a task as per the schedule given.
What would be a good alternative to use for CRON jobs in ASP.NET? I'd like to use a Web service, but that will not work in a shared hosting environment. Any help would be appreciated, and please advise a way to do this specifically in a shared hosting environment.
Anacron - Anacron is a periodic command scheduler just like cron. The only difference is that it does not need your computer to be always running. fcron - Fcron is the best of both cron and anacron. It doesn't require your computer to be running 24×7, and it can work with tasks on an hourly or minute basis.
A cron job is a Linux command used for scheduling tasks to be executed sometime in the future. This is normally used to schedule a job that is executed periodically – for example, to send out a notice every morning. Some scripts, such as Drupal and WHMCS may require you to set up cron jobs to perform certain functions.
For that purpose, as a system administrator, you can define background jobs (for example, database clean-ups) which are executed without any need for user interaction. These jobs are typically referred to as cron jobs.
Cron allows you to create your own chains manually. Scheduler allows you to place resource control (CPU limits, undo tablespace limits, etc) against your job. It allows you to define classes with priorities and assign jobs to those classes.
Try Quartz.NET. It's a decent .NET scheduler which supports CRON expressions, CRON triggers and various other means and methods to schedule tasks to be performed at certain times / intervals.
It even includes a basic Quartz.NET server (Windows Application) that might fit your needs.
Edit:
If you can't run applications or windows services within your shared hosting then perhaps something like "Easy Background Tasks in ASP.NET" will do you? It simulates a Windows Service using HttpRuntime.Cache
and removes the need for any external dependancies.
This is absolutely a hack, but you can simulate a cron service using ASP.NET callbacks. Here is an example of how to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With