안녕하세요 이승현이라고 합니다.
리눅스에 crond 가 있는데 사용하는 방법을 잘몰라서 이렇게 질문을 올립니다.
먼저 제가 진행한 순서대로 기술하자면
1. iptest.sh 라는 스크립트를 만든다
eth0의 ip가 올바른 값으로 존재하는가를 확인하는 스크립트 입니다.
결과 값으로 iptest.log 라는 파일에 마지막으로 수행한 날자를 무조건 저장하도록 만들
어져 있습니다. 2. crontab -e 를 이용 crond 에 등록한다.
#crontab -e
# root crontab file
05 * * * * root run-parts /root/bin/iptest.sh
15 * * * * root run-parts /root/bin/iptest.sh
25 * * * * root run-parts /root/bin/iptest.sh
35 * * * * root run-parts /root/bin/iptest.sh
45 * * * * root run-parts /root/bin/iptest.sh
55 * * * * root run-parts /root/bin/iptest.sh
:wq
이상.
3. crontab -l을 이용 확인한다.
# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.1494 installed on Tue Nov 20 06:46:20 2001)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# root crontab file
05 * * * * root run-parts /root/bin/iptest.sh
15 * * * * root run-parts /root/bin/iptest.sh
25 * * * * root run-parts /root/bin/iptest.sh
35 * * * * root run-parts /root/bin/iptest.sh
45 * * * * root run-parts /root/bin/iptest.sh
55 * * * * root run-parts /root/bin/iptest.sh
이렇게 해서 10분 간격으로 iptest.sh를 돌리려고 했는데 어찌된일인지
자동으로 생성되어야할 파일이 생성되지 않습니다.
아무래도 크론데몬이 동작하지 않는듯 싶은데요...
무슨 다른일을 해줘야 하나요? 아님 제가 run-parts 라는 괜한 단어를 적어넣은것인가요?
그럼 고수님들의 한수 가르치심을 기다리며..
--
리눅스를 잘하자