简体   繁体   English

Quartz.Net使用Windows任务计划

[英]Quartz.Net using windows task schedular

I'm looking at having a scheduled task (Console app) that will run every 20 minutes. 我正在查看一个计划任务(控制台应用程序),该任务每20分钟运行一次。

I've looked into using Quartz.Net for doing this, and it looks great but I can't see if it will work with my console application. 我已经考虑使用Quartz.Net进行此操作,它看起来很棒,但是我看不到它是否可以与我的控制台应用程序一起使用。

What I want is: 我想要的是:

  • If I use only quartz.net then this console application will have to be open forever for my code to be run on schedule. 如果仅使用quartz.net,则必须永久打开此控制台应用程序,才能按计划运行我的代码。 Is there a way where I can have windows run my Quartz.Net scheduled task for me every 20 minutes? 有什么方法可以让Windows每20分钟为我运行一次Quartz.Net计划任务?

So, Windows Task Schedular --20 mins--> run console app using Quartz.Net. 因此,Windows Task Schedular --20分钟->使用Quartz.Net运行控制台应用程序。

Or should I make a standard .NET Console App and just have it run the console app every 20 mins? 还是我应该制作一个标准的.NET控制台应用程序,让它每20分钟运行一次控制台应用程序?

Cheers 干杯

Don't mix Task Scheduler with Quartz they are 2 different methods of doing things. 不要将Task Scheduler与Quartz混合使用,它们是两种不同的处理方法。

Normally Task Scheduler is configured at an interval to run Console Applications that just do the work and close. 通常,将Task Scheduler配置为间隔一定时间以运行仅完成工作并关闭的控制台应用程序。

The suggested way to use Quartz is to Embed it in in a windows service application. 建议使用Quartz的方法是将其嵌入Windows服务应用程序中。 Then install this service on the server and configure it to run always and automatic start (This should protect you from crashes and kills and ensure the application will be running always unlike a console application) 然后在服务器上安装此服务,并将其配置为始终运行并自动启动(这可以保护您免受崩溃和杀伤,并确保该应用程序始终不同于控制台应用程序运行)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM