crontab 잊기 쉬운 점 본문

Programming

crontab 잊기 쉬운 점

halatha 2013. 2. 28. 09:27

10분마다 실행

*/10 * * * * something


실행 경로 및 로그 경로는 절대 경로 사용


연속 명령은 ;나 &&로 연결


log에 날짜 남길 때 \ 사용 잊지 말 것(없으면 동작 안 함)

* * * * * echo 'test' > /some/directory/path/log.`date +\%Y-\%m-\%d-\%H-\%M-\%S`.log

* * * * * echo 'test' > /some/directory/path/log.$(date +\%Y-\%m-\%d-\%H-\%M-\%S).log


cron 동작 살펴보고 싶으면

# tail -f /var/log/cron


Comments