ubuntu/crontab 지정시간에 백업하기
crontab
mac 기준임. svn로컬 백업용으로 정리.
- crontab file 생성. 없으면 신규, 있으면 있는 파일이 열림. vi로.
>crontab -e crontab: no crontab for stonerain - using an empty one
- 인자
Arg 1 : minute ( 0 – 59 ) Arg 2 : hour ( 0 – 23 ) Arg 3 : day of month ( 1 – 31 ) Arg 4 : month ( 1 – 12 ) Arg 5 : day of week ( 0 – 6 ) 0 : 일요일 Arg 6 : 명령어
- 저장하고 나오면 다음 메세지 출력.
crontab: no crontab for stonerain - using an empty one
- 샘플.
매일 새벽 4시 실행 : 0 4 * * * /repository/cron.sh 매주 월,수,금요일에 오전 6:30분 실행 : 30 6 * * 1,3,5 /repository/cron.sh 8월 매일 자정 실행 : 0 0 * 8 * /repository/cron.sh
- 현재 걸려있는 리스트보기
>crontab -l 0 4 * * * /repository/cron.sh
확인되지 않은 내용들
- crontab 실행 로그 위치.
/var/log/cron
- mybatchfile 파일을 /var/admn/cron/crontabs 로 옮긴다.
crontab mybatchfile