English 中文(简体)
十二. 每月第二星期一(朝 Hang)按时间顺序发言
原标题:Cron Expression for every second Monday of the month (for Hangfire)

I am trying to create recurring job in hangfire that runs, once a month at the second Monday, something like this: 1. Monday, May 14, 2018 8:00 AM 2. Monday, June 11, 2018 8:0 AM 3. Monday, July 9, 2018 8:00 AM 4. Monday, August 13, 2018 8:00 AM 5. Monday, September 10, 2018 8:00 AM

我发现。 但是,由于这不是安排hang工的标准条件,我无法使用。

My question is can I make an expression like this using the format * * * * * (min hour day/month month day/week)

问题回答

下面是每2个星期一3个不同的时间,审视模式,并根据需要改变时间

For each second Monday of the month at 00:00 hrs, try below: 0 0 0 ? 1/1 MON#2 *

For each second Monday of the month at 10:30 hrs, try below: 0 30 10 ? 1/1 MON#2 *

For each second Monday of the month at 13:30 hrs, try below: 0 30 13 ? 1/1 MON#2 *

如其他答复所示,使用诸如<代码>Mon#2等星期天:non-standard,但ISC Cron(大多数系统使用的Vxie Cron衍生工具,包括大多数的六氯环己烷分布和生物浓缩)。 它肯定没有出现在Debian最新试验包中3.0pl1-186+b1。

更切合这一问题,它询问了C#的Hangfire,。 履行经常任务 文件含糊不清,仅指出“你也可以使用CRON ,具体指明一个更为复杂的时间表”,依靠Wikipedia链接提供进一步的细节。 Digging further, the HangfireIO “克罗诺斯项目,我假定是基本原理的实施,事实上,它支持非标准<代码>L、<代码>W和#

这意味着,夜总会用户实际上可以使用<条码>0, * 单第2条,在每月第二周的8a运行。 (此处的其他答复使用问题标识,但HangfireIO s docs 说,在执行时使用*的同义词,因此我认为没有理由添加另一个非标准性质。)


这里的解决办法没有非标准性质,应当针对诸如BSD和Ltlin等六种式系统:

#m  h   dom mo  dow command
0   8   *   *   Mon d=$(date +\%e) && [ $d -ge 8 ] && [ $d -le 14 ] && echo "2nd Monday"

由于骑士可以自行处理此事,我们援引<条码><>日,以至月日,然后确保月8日到第14日。 否则,我们本可以实施如下规定:0 8-14* * [(date +/%w) = 1] &&呼呼呼“2nd星期一,但“跳板工作”每月(每年72次)6次,而这一跳板工作(无)每月3-4次(每年40次),从而减少了 your。

由于Hangfire是C#,而且可能不会采用一种六种式系统,因此,你应当依靠Bash/Possixth壳逻辑或Possixthdate的指挥。 由于<代码>#并非标准,本回答是完整的。

请注意:<0>0 8-14* Mon将不工作,因为起步时间为月和周日,而不是交叉点;这一指挥将在任何星期一至星期五的第八至十四天进行。

Here you go.

0 0 12 ? 1/1 MON#2 *




相关问题
Cron on XAMPP (Mac OS)

I have installed XAMPP server on my Mac OS, how to setup a cron job on it? My requirement is that i want to call a php script at regular intervals . Thanks

Call function periodically in Java

we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server ...

Cron in Google App Engine

I have made an app using Google App Engine in python of weekly Project and assessment report submitting. I want to check that on Friday who have submitted the report and who don t just send the ...

Mysql trigger/events vs Cronjob

I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is ...

Run a PHP script every second using CLI

I have a dedicated server running Cent OS with a Parallel PLESK panel. I need to run a PHP script every second to update my database. These is no alternative way time-wise, it needs to be updated ...

Batch Job Dependencies Using Open Source/Free Software

I run a large data warehouse plant where we have a lot of nightly jobs running concerruently however many have dependencies on a extract or data load process before they start. Currently we use an ...

Automatic Database reads/write every second

I am making an auction website, which has an auto-bid system. This system lets people make biddings without having to be there. My question is how to implement such a system. I have made the php ...

热门标签