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.
source share