Rsync synchronization service configuration note
When pushing or capturing data, Rsync has performance problems on the rsync client. Pay attention to this in a production environment with a large load and a large amount of data. This article is just a personal configuration example. It can be used in the actual environment after simple modification. rsync not only enables replication between servers, but also facilitates synchronization of local directories, other functions, such as real-time synchronization, are to be supplemented.
1. linux rsync service configuration example
(1) Client synchronization script
#! /Bin/bash
# Author: koumm
# Desc: backup for/data/to 10
# Date: 20xx-xx-xx
# Version: v1.0
# Modify:
# Rsync bak
End_date = 'date + % Y/% m/% d _ % H % M % s'
/Usr/bin/rsync-vzrtopg -- delete/data/192.168.200.10: ip6/-- exclude "tmp/" -- port = 1865
Echo ""
Echo "###################################### ######"
Echo "rsync completed time is: $ end_date"
Echo "###################################### ######"
(2) join a scheduled task
# Crontab-e
*/Root/system/rsync_bak_to_10.sh
(3) Server Configuration
# Vi/etc/rsyncd. conf
Uid = root
Gid = root
Max connections = 36000
Use chroot = no
Log file =/var/log/rsyncd. log
Pid file =/var/run/rsyncd. pid
Lock file =/var/run/rsyncd. lock
[Ip6]
Path =/data/project_bak/IP6
Comment = IP6
Ignore errors
Read only = no
Write only = no
List = no
Hosts allow = 192.168.200.0/24
# Auth users = www
# Secrets file =/etc/rsyncd. secrets
The server configures automatic start upon startup and manually executes the startup command.
# Vi/etc/rc. local
/Usr/bin/rsync -- daemon -- port = 1865
Restart rsync to kill the process. First ps-ef | grep rsync finds the process number, then kill-9 xxxx, and then start.
2. install and configure the cwRsync server and client in windows
Client: cwRsync_4.1.0_Installer.zip
Server: cwRsyncServer_4.1.0_Installer.zip
By default, the configuration file is as follows:
(1) modify the rsyncd. conf configuration file (C: \ Program Files \ ICW \ rsyncd. conf)
Use chroot = false
Strict modes = false
Hosts allow = *
Log file = rsyncd. log
Gid = 0
Uid = 0
[Gzbak]
Path =/cygdrive/d/data
Read only = false
Transfer logging = yes
Modify the windows Service, configure rsyncserver to start, and start automatically.
(2) Example of cwRsync synchronous backup script
Rsync. bat
@ Echo off
Cls
"C: \ Program Files \ cwRsync \ bin \ rsync.exe"-avr -- delete/cygdrive/c/opt 192.168.233.14: gzbak/-- port = 1865
(3) Configure windows scheduled tasks
Rsync + inotify implement real-time synchronization and backup of Git data
Rsync for file backup Synchronization
Rsync synchronizes two servers
Remote synchronization of Rsync in CentOS 6.5
Use Rsync in Ubuntu Linux for data backup and Synchronization
Linux uses the Rsync client to synchronize directories with the server for backup
Rsync details: click here
Rsync: click here
This article permanently updates the link address: