event listening in a directory, add the -- exclude or -- excludei parameter for inotifywait. for details, see man inotifywait. The inotifywait command generates three return values: "date, time, and file", which are passed as parameters to read, therefore, the "while read d e f" statement in the script details the return value. Grant the script executable permission [root @ server1 ~] # Chmod + x inotify_rsync.sh run the script [root @ server1 ~] #/R
Protocol (code 5) at MAIN.C (1522 ) [receiver=3.0.3] Reason: The server does not exist for the specified module. Provide the correct module name or modify the server side to the module you want to solve the problem. Question four: Rsync-auzv--progress--password-file=/etc/rsync.pas [emailprotected]::backup/home/ Rsync:could not open password file "/etc/rsync.pas": No such file or directory (2) Password: @ERROR: Auth failed On module backup
irrelevant IO errors
Read Only = yes # reading only
List = no # does not allow column files
Auth users = inburst # authenticated username, if not, indicates anonymous
Secrets file =/etc/inburst.pas # Certified file name
[web]
Path =/usr/local/apache/htdocs/
Comment = inburst.org Web server
3. Generate a password file on the server side/etc/inburst.pas
bash-2.03# Cat/etc/inburst.pas
Inburst:hack
For security purposes, the properties of a file must be only owner-readable.
4, on the server si
not used, it indicates that it is anonymous.Secrets file =/etc/inburst. Pas # authentication file name
[Web]Path =/usr/local/Apache/htdocs/Comment = inburst.org Web Server
3) generate a password file on the server/etc/inburst. Pas
Bash-2.03 # Cat/etc/inburst. PasInburst: hack
For security purposes, the attributes of a file must be readable only by the owner. 4) Start rsync on the server as a daemon
Bash-2.03 #
used, it indicates that it is anonymous.Secrets file =/etc/inburst. Pas # authentication file name
[Web]Path =/usr/local/Apache/htdocs/Comment = inburst.org Web Server
3. Generate a password file on the server/etc/inburst. Pas
Bash-2.03 # Cat/etc/inburst. PasInburst: hack
For security purposes, the attributes of a file must be readable only by the owner.
4. Start rsync on the server as a daemon
Bash-2.03 # rsync
same time, rsync can transmit files through ssh to ensure transmission security.
# Rsync command working mode: # First: shell mode, also known as local mode # Second: Remote shell mode. in this case, you can use the ssh protocol to host the data transmission process # third: the list mode works in a similar way as ls. it only lists the source con
Document directory
Always use rsync over ssh
Rsync command common options
Task: Copy file from a local computer to a remote server
Task: Copy file from a remote server to a local computer
Task: Synchronize a local directory with a remote directory
Task: Synchronize a remote directory with a local directory
Task: Synchronize a local directory with a remot
1. Rsync+inotify Synchronization Logic diagram650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/24/E7/wKiom1NWH9zSygnhAAESOQCBlMs996.jpg "alt=" Wkiom1nwh9zsygnhaaesoqcblms996.jpg "/>2. Environment deployment
Host Name
Host IP Address
System version
System Kernel Version
Inotify-master
192.168.30.130
CentOS 6.5
2.6.32-358.el6.x86_64
Inotify-slave
192.168.30.131
873.The rsync client is the server that initiates the rsync connection and installs rsync.After the Rsync client initiates the connection, the Rsync server checks that the Rsync client submits the user name and password built into the r
# Certified file name
[web]
Path =/usr/local/apache/htdocs/
Comment = inburst.org Web server
3. Generate a password file on the server side/etc/inburst.pas
bash-2.03# Cat/etc/inburst.pas
Inburst:hack
For security purposes, the properties of a file must be only owner-readable.
4, on the server side will rsync in the form of daemon launch
bash-2.03# rsync--daemon
There are several different ways to start a s
backed up because they are being read or written (for example, tcpdump traffic files), MV. Sh is required to meet this requirement.
Transfer Station handling
The processing of the intermediate station (rsync client) is mainly divided into two parts: backing up the file to the local and uploading the local backup file to the destination (hadoop HDFS ). During the upload process, there are two types of files: files in the append directory form
starts properly.
II. Installation Configuration Rsync Client
1. Install the Rsync client program until the installation is complete.
2. Test the connectivity of the server rsync. The corresponding address and port at which the Rsync client resides on the computer telnet to the
file=/var/log/rsyncd.log #日志文件存放目录ignore errors #忽略错误read only=false #表示可读可写list =false# Indicates that a remote list can be hostsallow=192.168.0.0/24 #允许主机地址hosts deny=0.0.0.0/32 #拒绝主机地址auth users=rsync_backup #运行服务的用户secrets file=/ etc/rsync.password #密码文件 #####################[backup] #模块名字comment = Thisisluruiqiwritter #注释path =/backup #需要备份的目录, preferably the same as the module name, easy to find ################### ################[[emailprotected]_server~]#
For the choice of Linux as an application platform for small and medium-sized enterprises or Web sites, often face how to achieve remote Data backup or Web site mirror image of the problem, although there are commercial backup and mirror products to choose from, but these products are often too expensive prices. So how to use free software to efficiently implement remote backup and Web site mirror image is a topic worthy of discussion.
The easiest way to make remote data backups or Web site mir
= noSocket_type = streamWait = noUser = rootServer =/usr/bin/rsyncServer_args = -- daemonLog_on_failure + = USERID}Above, We need to enable the rsync daemon. Once an rsync client is connected, xinetd will forward it to rsyncd (port 873 ). Then the service xinetd restart takes effect.Rsync server and FirewallLinux Firewall uses iptables, so we should at least let the defined
= NoSocket_type = streamWait = NoUser = rootServer =/usr/bin/rsyncServer_args = -- daemonLog_on_failure + = userid}Above, We need to enable the rsync daemon. Once an rsync client is connected, xinetd will forward it to rsyncd (Port 873 ). Then the service xinetd restart takes effect.Rsync server and FirewallLinux Firewall uses iptables, so we should at least let the defined
server (standalone boot)#/usr/bin/rsync–daemon2. Start the rsync server (with XINETD super process boot)#/etc/rc.d/init.d/xinetd ReloadExample:[Email protected] ~]#/etc/rc.d/init.d/xinetd ReloadReload configuration: [OK]Four: Join rc.localIn various operating systems, the RC file storage location is different, can be modified to enable the system to load the rsync
: Refers to the user name of the access Data_backup
Secrets file:data_backup the password file corresponding to the username.
3. New password file: E:\Setting\Rsync\rsync_db.ps. Such as:
Root:root
admin:12345
Password file format: Username: password (root:12345), one line, some system does not support long password, the other password file permissions to other user groups are unreadable, set the wrong may not work. Under Windows, password file
configuration segments: You can have multipleFor example: [Share_name] #定义共享名 #有点类似Samba1.3.4, rsync-Monitored portsThe port that rsync listens on is 873.1.3.5, rsync command formatAccess via rsync daemon:#从远端服务器拉去数据 Pull:rsync [OPTION ...] [[email protected]]Host::src ..
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.