월루를 꿈꾸는 대학생

Centos8 rsync remote 백업 본문

Server&Network/Capston

Centos8 rsync remote 백업

하즈시 2020. 9. 21. 20:53
728x90

기본 정보

 

agent : 192.168.109.134

 

rsync : 192.168.109.133

 

해당 ip는 언제든지 바뀔 수 있기 때문에 바뀌면 항상 수정 필요하다

 

agent의 파일이 rsync 쪽으로 백업 되는 것 

agnet = source

rsync = destination 

 


rsync 설정

 

dnf -y install rsync

 

이후 딱히 없다 임마는 그냥 설치만 하고 중요한거는 agent 에서 설정임

 


 

agent 설정

 

dnf -y install rsync rsync-daemon

 

nano /etc/rsymcd.conf

 

 

# add to the end
pid file = /var/run/rsyncd.pid

log file = /var/log/rsyncd.log

max connections = 4

 

# log transfer results or not

transfer logging = yes

 

# any name you like

 

[backup]

# target directory to copy   <- 해당 agent의 폴더 즉 백업할 경로임! 

path = /home/backup

 

# hosts you allow to access

hosts allow = 192.168.109.133   # 이거는 해당 rsync 쪽 적어주기 

hosts deny = *

uid = root

gid = root

use chroot = yes

timeout 300

 

setsebool -P rsync_full_access on # < 해당 폴더에서

 

firewall-cmd --add-service=rsyncd --permanent

firewall-cmd --reload


설정 끝 

적용 시작

 

rsync -avz 192.168.109.134::backup /home/kikai/backup/

 

 

 

 


자동화 

 

crontab -e 

위와 같이 설정 

 

nano /etc/

 

 

 


추가

 

agent

 

rsync

 

 

삭제

 

agent

 

 

rsync 

 

 

 

 

 

출처

https://www.server-world.info/en/note?os=CentOS_8&p=rsync

 

CentOS 8 : Rsync : File Sync : Server World

  Copy files or directories from one location to an another localtion by [rsync]. For Localhost ⇔ RemoteHost synchronizing, SSH is used for secure connection, so SSH Server is needed on RemoteHost. On this example, Configure and Run [rsync] as a daemon.

www.server-world.info

 

https://osasf.net/discussion/606/rsync-%EC%84%A4%EC%B9%98-%EB%B0%8F-%EC%82%AC%EC%9A%A9-%EB%B0%A9%EB%B2%95-%EC%84%9C%EB%B2%84%EA%B0%84-%EB%98%90%EB%8A%94-%EC%84%9C%EB%B2%84%EB%82%B4-%ED%8C%8C%EC%9D%BC-%EB%8F%99%EA%B8%B0%ED%99%94-crontab%EC%9D%84-%ED%86%B5%ED%95%9C-%EC%8A%A4%EC%BC%80%EC%A5%B4%EB%A7%81-%ED%8F%AC%ED%95%A8

 

Rsync 설치 및 사용 방법(서버간 또는 서버내 파일 동기화)(Crontab을 통한 스케쥴링 포함)

리눅스의 rsync 패키지를 사용해서 서버간 또는 서버내 디렉토리 및 파일을 전송하고 동기화할 수 있는 방법입니다.

osasf.net

 

728x90

'Server&Network > Capston' 카테고리의 다른 글

Linux workstation pro 16 error 해결  (0) 2020.09.22
Linux VM workstation pro 16 설치방법  (0) 2020.09.22
Centos8 Cacti  (0) 2020.09.20
Cisco 장비 모니터링  (0) 2020.09.20
zabbix랑 log 서버 동시에 돌리기  (0) 2020.09.18