Do something according to some schedule in ASP.NET.

I need to do some work, for example, every Monday and Sunday at 7 oโ€™clock. I wrote a web service that can do this work, but I donโ€™t know how to run this web service at the right time. Can anyone help me out?

PS I use Mono and mod_mono on Mac OS X.

+4
source share
2 answers

On Windows, you usually create a console application to call a web service and it will be added to the task scheduler.

For Mac OS X, you can try to do something similar and use cron. Check out this post .

+3
source

There are several ways to solve this problem, but whichever approach you choose, it is probably best to run a scheduled task outside the web process.

You can create a simple console application that does the necessary work and configure the cron task to run it on Mac OS X (similar to the scheduled tasks on Windows). Alternatively, you can use something like Quartz.Net to create scheduled tasks, and then run the process as a daemon on Mac OS.

The difference between them is that the daemon works constantly and works according to the schedule defined by the program, the console application is launched only when necessary and launched by a system-level process such as cron.

+2
source

Source: https://habr.com/ru/post/1342724/


All Articles