월루를 꿈꾸는 대학생
Centos8 rsync remote 백업 본문
기본 정보
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
Rsync 설치 및 사용 방법(서버간 또는 서버내 파일 동기화)(Crontab을 통한 스케쥴링 포함)
리눅스의 rsync 패키지를 사용해서 서버간 또는 서버내 디렉토리 및 파일을 전송하고 동기화할 수 있는 방법입니다.
osasf.net
'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 |