Posts auto-deploy
Post
Cancel

auto-deploy

auto deploy

1. crontab

설치

  1. yum install crontab
  2. systemctl start crond
  3. ps -ef grep crond

편집

1
2
3
crontab -e  ### 조회
crontab -l ### 리스트 전체 삭제 
crontab -r

작성방법

1
2
3
4
5
6
7
8
9
# Example of job definition:
# .---------------- 분 (0 - 59)
# |  .------------- 시간 (0 - 23)
# |  |  .---------- 일자 (1 - 31)
# |  |  |  .------- 월 (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- 요일 (0 - 6) (일요일=0 or 7) OR 일요일(0 또는 7), 월요일(1), 화요일(2), 수요일(3), 목요일(4), 금요일(5), 토요일(6)
# |  |  |  |  |
# *  *  *  *  * 사용자명  작업할 내용

예시

  • crontab -e ``` SHELL=/bin/bash PATH=/usr/local/bin:/usr/bin:/bin
          • /root/git_pull_job.sh ```
  • git_pull_job.sh
    1
    2
    
    cd /root/www/homepage && git pull
    cd /root/www/blog && git pull
    

2. openssh-server

3. git

Links

crontab

https://ossian.tistory.com/76

openssh-server

https://youngmind.tistory.com/entry/CentOS-%EA%B0%95%EC%A2%8C-PART-2-1-SSH-Server-%EA%B5%AC%EC%B6%95%EA%B3%BC-%EC%9A%B4%EC%98%81

git

https://bamdule.tistory.com/54

This post is licensed under CC BY 4.0 by the author.