定時再起動の組み込み
cron の設定
LuCI → System → Scheduled Tasks
# 毎日午前 4 時 30 分に再起動 # 注: 無限の再起動ループを避けるために、70 秒待ちます # そして /etc のファイルをタッチして、時計が設定されるようにします # cron が開始する前に、再起動時に適切に 4:31 に。 # https://openwrt.org/docs/guide-user/base-system/cron#periodic_reboot 30 4 * * * sleep 70 && touch /etc/banner && reboot
* * * * * command to execute - - - - - | | | | | | | | | ----- 曜日 (0 - 6) (0:日, 1:月,2:火, 3:水, 4:木, 5:金, 6:土) | | | ------- 月 (1 - 12) | | --------- 日 (1 - 31) | ----------- 時 (0 - 23) ------------- 分 (0 - 59)
分 0-59 | 時 0-23 | 日 1-31 | 月 1-12 | 曜日 0-6 | 説明 |
---|---|---|---|---|---|
*/5 | * | * | * | * | 5分ごと |
12 | */3 | * | * | * | 3時間ごとの12分 |
57 | 11 | 15 | 1,6,12 | * | 1月、6月、12月の15日11:57 |
25 | 6 | * | * | 1-5 | 平日06:25(月〜金) |
0 | 0 | 4,12,26 | * | * | 毎月4日、12日、26日の深夜0:00 |
5,10 | 9,14 | 10 | * | 0,4 | 毎週日曜日、木曜日の 09:05、09:10、14:05、14:10 |
ショートカット | 同等の内容 | 説明 |
---|---|---|
@yearly | 0 0 1 1 * | 毎年 |
@annually | 0 0 1 1 * |
|
@monthly | 0 0 1 * * | 毎月 |
@weekly | 0 0 * * 0 | 毎週 |
@daily | 0 0 * * * | 毎日 |
@midnight | 0 0 * * * |
|
@hourly | 0 * * * * | 毎時 |