Constructing cron expressions in Crowd

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

A cron expression gives you more control when scheduling directory synchronization comparing to polling interval. For example, you could define a cron expression to run directory synchronization at 8:15 am on the second Friday of every month. This page describes how to construct a cron expression. 

This functionality is available for Crowd Data Center only


cron 式の作成

cron 式は、スペースで区切られた複数の文字列フィールドです。次の表は cron 式の各フィールドす。この並び順で、左から右に指定する必要があります


時間Month曜日年 (任意)
指定可能な値0-590-590-231-311-12 or JAN-DEC1-7 or SUN-SAT1970-2099
許可される特殊文字 , - * /, - * /, - * /, - * / ? L W C, - * /, - * / ? L C #, - * /

cron 式では 大文字 / 小文字を区別しません。

次のような例があります。

0 15 8 ? JAN MON 2014


これを直訳すると、0 秒、15 分、8 時、月の任意の日付、1 月、月曜日、2014 年となります。

通常の表記に置き換えると、2014 年 1 月のすべての月曜日の午前 8:15 となります。? 文字は "特定の値を持たない" という意味です。この例では、月の日付を設定していません。曜日を設定してるため、日付を指定する必要はありません。特殊文字については、次のセクションで説明します。

More examples of cron expressions are explained in the examples section at the bottom of this page.

特殊文字

特殊文字

用途

,

Specifies a list of values. For example, in the Day-of-week field, 'MON,WED,FRI' means 'every Monday, Wednesday, and Friday'.

-

Specifies a range of values. For example, in the Day-of-week field, 'MON-FRI' means 'every Monday, Tuesday, Wednesday, Thursday and Friday'.

*

Specifies all possible values. For example, in the Hour field, '*' means 'every hour of the day'.

/

Specifies increments to the given value. For example, in the Minute field, '0/15' means 'every 15 minutes during the hour, starting at minute zero'.

?

Specifies no particular value. This is useful when you need to specify a value for one of the two fields Day-of-month or Day-of-week, but not the other.

L

Specifies the last possible value; this has different meanings depending on context. In the Day-of-week field, 'L' on its own means 'the last day of every week' (i.e. 'every Saturday'), or if used after another value, means 'the last xxx day of the month' (e.g. 'SATL' and '7L' both mean 'the last Saturday of the month). In the Day-of-month field, 'L' on its own means 'the last day of the month', or 'LW' means 'the last weekday of the month'.

W

Specifies the weekday (Monday-Friday) nearest the given day of the month. For example, '1W' means 'the nearest weekday to the 1st of the month' (note that if the 1st is a Saturday, the email will be sent on the nearest weekday within the same month, i.e. on Monday 3rd). 'W' can only be used when the day-of-month is a single day, not a range or list of days.

#

特定の第 n 曜日を指定します。たとえば、「TUES#2」 (または「3#2」) は、「その月の第 2 火曜日」を意味します。

0 15 20 ? * *

毎日午後 8 時 15 分。

0 15 8 * * ?

毎日午前 8 時 15 分。

0 * 14 * * ?

毎日午後 2 時 00 分から午後 2 時 59 分までの 1 分間隔。

0 0/5 14 * * ?

毎日午後 2 時 00 分から午後 2 時 55 分までの 5 分間隔。

0 0/5 14,18 * * ?

毎日午後 2 時 00 分から午後 2 時 55 分までの 5 分間隔、および毎日午後 6 時 00 分から午後 6 時 55 分までの 5 分間隔。

0 0-5 14 * * ?

毎日午後 2 時 00 分から午後 2 時 05 分までの 1 分間隔。

0 0/10 * * * ? *

期間指定なしの (永久に続く) 10 分間隔。

0 10,44 14 ? 3 WED

3 月の毎週水曜日の午後 2 時 10 分および午後 2 時 44 分。

0 15 8 ? * MON-FRI

毎週月、火、水、木、金曜日の午前 8 時 15 分。

0 15 8 15 * ?

毎月 15 日の午前 8 時 15 分。

0 15 8 L * ?

毎月最終日の午前 8 時 15 分。

0 15 8 LW * ?

毎月最後の平日の午前 8 時 15 分。

0 15 8 ? * 6L

毎月最後の金曜日の午前 8 時 15 分。

0 15 8 ? * 6#2

毎月第 2 金曜日の午前 8 時 15 分。

0 15 8 ? * 6#2 2007-2009

2007 年、 2008 年、2009 年の毎月第 2 金曜日の午前 8 時 15 分。

最終更新日 2021 年 4 月 8 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.