Crontab and Cron?
리눅스에서 특정 시간에 특정한 명령을 실행하는 deamon(background process)을 Cron이라고 한다. Cron deamon이 원하는 시간에 원하는 명령을 수행하도록 리스트를 만드는 것이 Crontab
How to use Crontab
Crontab 편집
# m h dom mon dow command
0 4 * * * /sbin/rebootCrontab 내용
$ sudo crontab -l
Crontab 전체 작업 삭제
$ sudo crontab -r
Crontab 주기
m h dom mon dow command
분 시간 일 월 주 실행 command
0~60 0~23 0~31 0~12 0~6(일~월)
매 분마다 실행
`* * * * * /sbin/reboot ㅗㅓㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅕㅛ
매 정시마다 실행
`0 * * * * /sbin/reboot
12월 15일 매 6시간마다 각 시간 30분에
`30 1-23/6 15 12 * /sbin/reboot
Crontab service
$ sudo service cron start
$ sudo service cron stop
$ sudo service cron restart or $ sudo service crond restart
`$ sudo service cron status