LoginSignup
1
0

More than 1 year has passed since last update.

Amazon ECS の「タスクのスケジューリング」の設定について

Last updated at Posted at 2021-05-24

■Cron形式で設定する場合

NGの設定

cron(*/1 * * * * *)

結果 → Parameter ScheduleExpression is not valid

下記URLの「Wildcards」に記載があります。

The * (asterisk) wildcard includes all values in the field. In the Hours field, * would include every hour. You cannot use * in both the Day-of-month and Day-of-week fields. If you use it in one, you must use ? in the other.

曜日の項目が二つあり、両方に「*」は使用できないようです。

OKの設定

cron(*/1 * * * ? *)

片方を「?」にします。

■ECRのCMDを「タスクのスケジューリング」で上書きする場合

「タスクのスケジューリング」設定の「コンテナの上書き」にある「コマンドの上書き」に記載をします。
「docker-compose.yml」と異なり、「カンマ区切り」で入力を行います。

docker-compose.yml
command: ping 127.0.0.1

下記は「タスクのスケジューリング」での記述

ping,127.0.0.1

※カンマ区切りでダブルクォーテーションで区切られます。

カンマを入力したい場合は少し特殊になるようです。
※エスケープ文字が無いようです(見当たりませんでした)

下記のような形にすると「カンマ」を入力することができます。

TEST=$(printf "\x2c") && echo "te${TEST}st"

\x2c は「カンマ」になりますので、一度変数にいれて利用します。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0