cronのインストール
1 | apt-get install cron |
cronの実行、状態確認、停止
1 | service cron start |
cronの設定
1 | cp /etc/crontab /etc/cron.d/cron |
例えば以下のように追記します。
1 | */1 * * * * root echo "hello" >> /home/hoge/hello.txt |
cronの再起動
service cron restart
確認
1分ごとに、hello.txt
に追記されればOKです。
記事情報
- 投稿日:2020年6月26日
- 最終更新日:2020年6月26日