Personal tools
You are here: Home PC Linux crondの設定
Document Actions

crondの設定

by かわうぃん last modified 2006-11-11 09:59

プログラムを定期的に実行するcrondの設定ファイルについて

構文

crontab [ -u user ] file
crontab [ -u user ] { -l | -r | -e } 

オプション

 -u user 指定したユーザーのcron設定を行う 
 -l 登録されているcrontabを表示する 
 -r 登録されているcrontabを削除する 
 -e crontabを編集する

説明

プログラムを指定した時間に定期的に実行するためのデーモンcrondの設定を行う。設定はユーザーごとに用意されたcrontabという設定ファイルに記述する。crontabには以下のような書式で,各コマンドについて1行ずつ記述する。

crontabの書式  min hour day month week command

 min 分を指定する。ワイルド・カード(*)を使用できる 
 hour 時を指定する。ワイルド・カード(*)を使用できる 
 day 日を指定する。ワイルド・カード(*)を使用できる 
 month 月を指定する。ワイルド・カード(*)を使用できる 
 week 曜日を指定する。0を日曜日。ワイルド・カード(*)も使用できる 
 command 実行するコマンドまたはスクリプトを記述する

# 毎日、00:05に/sbin/ifconfigを実行する
5 0 * * *       /sbin/ifconfig
# 毎月 初日(1日)の 16:15 に実行する
15 16 1 * *   /sbin/ifconfig
# 平日の 22:00に実行する
0 22 * * 1-5 /sbin/ifconfig
# 毎日 0時から2時間おきに23時まで、44分毎に実行
44 0-23/2 * * * /sbin/ifconfig
# 日曜 04:05に実行
5 4 * * sun  /sbin/ifconfig
# 毎日10分おきに実行
*/10 * * * * /sbin/ifconfig

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: