configure
#vi /etc/rsyncd.conf # mkdir /etc/rsyncd # touch /etc/rsyncd/rsyncd.conf # ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf # Minimal configuration file for rsync daemon # See rsync(1) and rsyncd.conf(5) man pages for help # This line is required by the /etc/init.d/rsyncd script # GLOBAL OPTIONS uid = root gid = root use chroot = no read only = yes #limit access to private LANs hosts allow=192.168.1.0/255.255.255.0 192.168.31.0/255.255.255.0 hosts deny=* max connections = 5 pid file = /var/run/rsyncd.pid secrets file = /etc/rsyncd/rsyncd.secrets #lock file = /var/run/rsync.lock motd file = /etc/rsyncd/rsyncd.motd #This will give you a separate log file log file = /var/log/rsync.log #This will log every file transferred - up to 85,000+ per user, per sync transfer logging = yes log format = %t %a %m %f %b syslog facility = local3 timeout = 300 # MODULE OPTIONS [mysql_databack] path = /opt/db-backup/ list=yes ignore errors auth users = mysql comment = mysql_databack
Welcome message
#/etc/rsyncd/rsyncd.motd +++++++++++++++++++++++++++ + mysql databackp + +++++++++++++++++++++++++++
password file
#/etc/rsyncd/rsyncd.secrets #Username Password mysql:databackup
Add to boot
echo "rsync --daemon " >> /etc/rc.local
client configuration
timing synchronization file
vi /etc/crontab 10 2 * * * rsync rsync -avzP --delete --password-file=/home/rsync/rsync.password [email protected]::mysql_databack /opt/mysql
#/home/rsync/rsync.password #write only password data backup