Machines: Server A and backup server B
Operating System: RedHat
Backup policy: rsync + crontab, regular synchronization. The advantage is Incremental backup, which includes information such as file permissions and dates to facilitate fast recovery and switching between machines.
Server:
/Etc/rsyncd. conf
Uid = root
Gid = root
Use chroot = No
Max connections = 4
PID file =/var/run/rsyncd. PID
Lock file =/var/run/rsync. Lock
Log File =/var/log/rsyncd. Log
[Share]
Path =/home/filetobackup/
Ignore errors
Read Only = Yes
List = Yes
Auth users = Username
Secrets file =/etc/password. Pas
/Etc/password. PAS (permission 400)
Username: Password
Server B:
Backup. Sh
#! /Bin/bash
Date = 'date + % W'
/Usr/bin/rsync-vzrtopg -- Progress -- delete -- password-file =/root/script/password. PAS username @ servera_ip: Share/home/backuppath>/root/logs/rsync. $ date
/Root/script/password. PAS (permission: 400)
Password
Serverb executes script timed synchronization from Monday to Friday
Crontab:
0 1 ** 2-6/root/script/backup. Sh