minite hour day month week command
1 2 3 4 5 uptime >> /tmp/load.log
0 13 13 * 5 uptime >> /tmp/load.log
분(0-59) 시간(0-23) 일자(1-31) 월(1-12) 주(0,6) 명령어라인 5 4 * * 6 /usr/lib/newsyslog
field | allowed values | description |
---|---|---|
minute | 0-59 | 분 |
hour | 0-23 | 시간 |
day of month | 1-31 | 일 |
month | 1-12 (or names, see below) | 월 |
day of week | 0-7 (0 or 7 is Sun, or use names) | 주 |
command | specified command | 실행될 명령 |
n | n값과 일치 |
---|---|
n,p,q | n,p, or q와 일치 |
n-p | n과 p 사이의 값과 일치 |
* | 항상 일치 |
*/10 | 맨처음 실행시점부터 10분마다 |
*/1 | 먼처음 실행시점부터 1분마다 |
$ EDITER=vi $ export EDITOR
$ crontab -e 20 15 * * 5 /usr/bin/banner "TIME TO GO!" > /dev/console 0 0 * * * /usr/bin/tar cvf /dev/rmt/0 /export/home/rickyd :wq
$ crontab -l
0 13 13 * 5 su - jaeyjang -c "uptime >> /tmp/load.log"
0,30 09-18 * * * uptime >> /tmp/load.log
# run five minutes after midnight, every day 5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
# run at 2:15pm on the first of every month -- output mailed to paul 15 14 1 * * $HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe 0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
5 4 * * sun echo "run at 5 after 4 every sunday"