Tuesday, June 23, 2009

Cron

Cron은 일정한 시각에 특정 작업을 수행한다.

특정 작업은 crontab 파일에 정의된다.

minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command

crontab 파일의 각 필드는 위와 같이 구성된다.

crontab 사용법은 아래와 같다.
usage: crontab [-u user] file
crontab [-u user] { -e | -l | -r }
(default operation is replace, per 1003.2)
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)
-i (prompt before deleting user's crontab)

/etc 디렉토리에 보면 시스템 상에 이미 정의되어 있는 crontab 파일을 볼 수 있으며
/etc/cron.{hourly | daily | weekly | monthly} 이름의 디렉토리가 존재한다.

https://help.ubuntu.com/community/CronHowto

No comments: