LoginSignup
1
2

More than 1 year has passed since last update.

cronの使い方メモ

Last updated at Posted at 2021-08-16

概要

ジョブを定期実行するcronの簡単な説明。

crontab -e #cronにジョブを登録する.テキストエディタが起動する.

crontab -l #現在登録されているジョブが表示される.

crontab -r #ジョブを削除する.

cronの書き方

#初期状態(1分毎に実行)
* * * * * command

時間は整数値で指定。単位は前から分、時、日、月、曜日、最小単位は分なのでそれ以上の粒度で実行するには別に用意する必要がある。例:任意の時間内に任意の間隔でシェルスクリプトを実行する変なやつのメモ

指定可能な数値

単位 範囲 備考
0-59
0-23
1-31
1-12
曜日 0-7 0と7は日曜日

参考

【入門】cron(クロン)設定・書き方の基本

1
2
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
2