再起動と起動時にも30分ごとにcronジョブを実行します。

再起動と起動時にも30分ごとにcronジョブを実行します。

30分ごとにスクリプトです。

00,30 * * * * [path_to_file]/myscript.sh

再起動するたびに同じスクリプトを実行するのはなぜですか?

@reboot 00,30 * * * * [path_to_file]/myscript.sh

上記の内容は正しいですか?

ベストアンサー1

いいえ。これは2つの別々のルールです。

man 5 crontab
       Instead  of  the  first  five  fields, one of eight special strings may
       appear:

              string         meaning
              ------         -------
              @reboot        Run once, at startup.

おすすめ記事