IT/운영체제

리눅스, 예약작업 cron(크론) 데몬

DKSOFT 2022. 7. 21.
데몬 실행
# service crond start 

데몬 중지
# service crond stop

데몬 실행 여부 확인
# ps -ef | grep cron

 

데몬 일정 conf 파일 내용


17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

위 내용을 보면

17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
매시 17분에 /etc/cron.hourly 디렉토리내에 스크립트 실행

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
매일 06시 25분에 /etc/cron.daily 디렉토리내에 스크립트 실행

47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
매주 일요일 06시 47분에 /etc/cron.weekly 디렉토리내에 스크립트 실행

52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
매월 1일 06시 52분에 /etc/cron.monthly 디렉토리내에 스크립트 실행

 

참고

00 08 1-7 * * 
                         첫번째 00 – 0분
                         두번 째 08 – 8시
                         세번째 1-7 – 1일~7일 
                         네번째  * –  매월
                         마지막 *  – 매주  0-7 (0 또는 7=일요일, 1=월, 2=화,...)

댓글

💲 추천 글