/etc/crontabと/etc/cron.d/の書き方 /etc/crontabと/etc/cron.dの書き方メモです。 書式としては環境変数を設定し、実行するコマンド、シェルのスケジュールを記述という形になります。 参考としてCentOS 6.6の/etc/crontabの初期状態を見てみます。 「/etc/crontab」初期状態 SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of mo
Red Hat Linuxなどのcron設定では、標準で/etc/crontabに「MAILTO=」として、動作結果を特定のアカウントへ通知されるよう記述されている。 ここでの/etc/crontabには、システム自体(root)権限で実行されるものが定義されることから、その通知もroot宛になっている。 # cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 0 * * * root run-parts /etc/cron.daily 04 0 * * 0 root run-parts /etc/cron.weekly 06 0 1 * * root r
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く