ubuntu/crontab 지정시간에 백업하기

돌아다니면서 구한 자료로 공부하는 공간입니다..

틀린부분이 있다면 말씀해주시면 수정하도록 하겠습니다.

※ 남을 비방하거나 욕 / 정치적인 글은 삭제 대상이 됩니다. ※

ubuntu/crontab 지정시간에 백업하기

만키로군 0 1696 0

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

0 Comments