Azure的WebRole计划任务,每天早上 [英] Azure WebRole Scheduled Task Every Morning
问题描述
我试图找出解决的办法得到一个WebRole每天早上早上5点运行任务。我已经看过Quartz.Net和计算器,但所有这些例子预定任务每10分钟运行。有没有表现出任何的例子我该怎么安排呢?
I am trying to figure out a solution to getting a WebRole to run a Task every morning at 5AM. I have looked at Quartz.Net and the examples on stackoverflow but all of them schedule the task to run every 10 minutes. Are there any examples that show how I can schedule it?
推荐答案
Quartz.Net应该是很好的you.Try使用的 CronTrigger (或 CronTriggerImpl在 2.x版)。
Quartz.Net should be good for you.Try to use CronTrigger (or CronTriggerImpl in version 2.x).
的cron-EX pression的例子 - 0 0 5 * *?
- 每天早上5点运行
。
Example of cron-expression - "0 0 5 * * ?"
- run every day at 5 AM
.
触发克龙子前pression位置意思是:
Cron trigger sub-expression position meaning:
- 秒 -
0
你(在0跑秒) - 分 -
0
你(在0分钟内) - 小时 -
5
为你(在5个小时的运行; 它采用24小时制的) - 某一天的月 -
*
- 天天跑 - 月 -
*
你(运行每月) - 某一天的周 -
- 年(可选字段) - 的不使用的
- Seconds -
0
for you (run at 0 second) - Minutes -
0
for you (run at 0 minutes) - Hours -
5
for you (run at 5 hour; it uses 24-hour clock) - Day-of-Month -
*
- run every day - Month -
*
for you (run every month) - Day-of-Week -
?
- not specified for you (Day-of-Month has been used instead) - Year (optional field) - not used
这篇关于Azure的WebRole计划任务,每天早上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!