Tags: Linux operations Linux learning Linux Basics Linux EssentialsRsync is an open source, fast and versatile tool for simultaneous, full-scale, incremental, local or remote data backupand one of the essential skills of OPS personnel.. So how do ops people do when you deploy the architecture in OPS ?Rsyncthe wrong lin
Rsync is the data under Unix-like systems Mirror Backup tool--remote Sync,inotify is a Linux feature that monitors file system operations such as read, write, and create. The combination of the two enables real-time synchronization of files between the server and the client. Experimental logic diagram650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/1E/wKioL1WSWOrRsbMjAACrIefFLOE128.jpg "title="
source, he will prompt to enter the user's password, when we use the scheduled task to backup, it is impossible to stare at it in the password bar.We now, using a technology, is the SSH key pair authentication method, as long as the connection once, will not be required to enter a password.Modify the server-side SSH configuration file to enable key pair validation650) this.width=650; "title=" 6.png "src=" Http://s3.51cto.com/wyfs02/M01/70/70/wKioL1W4RJjhR6tjAAA4W2Vo6zk053.jpg " alt= "Wkiol1w4rj
get rsync-3.1.0 I put one in my net. Address:Http://pan.baidu.com/s/1dDs4lStInstallationrsync-3.1.0.tar.gz#tar zxvf rsync-3.1.0.tar.gz#cd rsync-3.1.0#./configure--prefix=/home/work/rsync#make#make InstallConfiguration file ExampleStartrsync--daemon--port 3334--config=/home/work/rsy
= $usersuijiEof#第二步, create a puppet user to perform rsyncUseradd-s/sbin/nologin-m rsync >>/dev/null#第三步, create a directory that stores data from each otherCD/ mkdir $usersuiji#第四步更改文件权限Chown-r Rsync.rsync $usersuiji#第五步创建密码文件及密码echo $usersuiji: $passwdsuiji >/etc/rsync.password#第六步修改密码配置文件的权限chmod 600/etc/rsync.password#第七步启动rsyncRsync--daemonecho "Account number: $usersuiji"echo "Password: $passwdsuiji"echo "Backup directory:/$usersuiji"echo "Modu
]/]# ls/ba Ckup/2017-11-04.tar.gz test.tar.gz2.3Saturday Package Special nameBecause the server needs to keep the Saturday package, you need to give the file a special name in order to differentiate it when you package the Saturday file.[[Email protected]/]# CD/ tar-zcvf/backup/$ (date +%f) _week6.tar.gz Etc/hostsetc/hosts[[email protected]/]# ls/backup/2017-11-04.tar.gz 2017-11-04_week6.tar.gz test.tar.gz2.4uploading files to the serverThe steps to install the
Take a look at the comparison chart, the image on the left is a copy of the common Rsync directory, the right figure is the use of the parallel tool and launched multiple rsynccentos6.5 Installation Parallel #!/bin/bash# Install parallel on CentOS 6 .# assumes is root. Prefix w /sudo if not.cd /etc/yum . repos.d/wget http:// download.opensuse.org/repositories/home:tange/centos_centos-5/home:tange.repo wget http:// download.opensuse.org/reposi
administrator mailbox(1) First modify the local send-mail configuration file to all:(2) Restart mail ServiceSystemctl restart Postfix(3) Send mail to admin-S indicates the message headerRoot accepted user @ behind can be followed by IP address or domain nameIf sent to QQ mailbox format: [email protected]Test success:3, finally in the backup server to achieve automated operation and maintenance:(1) Writing Automation scripts:(2) Configuration cycle operation:Crontab-eSummarize this experiment:Pr
"title=" 3.jpg " alt= "Wkiom1ycpbsaz-_baaf5a9wjmj4155.jpg"/>5. Edit the password file for the server/etc/backup.pass650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/6B/wKiom1YcpDyTgew7AABGkbBjpus280.jpg "title=" 4.jpg " alt= "Wkiom1ycpdytgew7aabgkbbjpus280.jpg"/>6. chmod 600/etc/backup.passSecond, the client configuration is as follows1. Edit the password file for rsync connection/etc/rsync_client.pass650) this.width=650; "src=" http://s
reads as follows:
The code is as follows
#!/bin/shRsync=/usr/local/bin/rsyncSsh=/usr/bin/sshKey=/home/localuser/.ssh/id_rsaRuser=remoteuserRhost=remotehostRpath=/remote/dirLpath=/this/dir$RSYNC-az-delte-e "$SSH-i $KEY" $RUSER @ $RHOST: $RPATH $LPATH
The-a option is equivalent to option-rlptgod. In simple terms, this option can be recursive to synchronize almost everything in the past, very useful. Note that-A d
Instant file transfer between Linux hosts, SCP commands are familiar to everyoneBut when the file to be transmitted is large, the process is more tragic if the network is interrupted. At this point you can consider using the rsync command instead of SCP to implement a breakpoint continuation file.Test: Rsync usesEnvironment: 2 Rhel 5.7Requirement: Host a transfer
starts automatically after booting rsync Service 650) this.width=650; "title=" 9.png "src=" Http://s3.51cto.com/wyfs02/M01/70/23/wKioL1WyWlCx8lq_AAA4jgszfZY960.jpg " alt= "Wkiol1wywlcx8lq_aaa4jgszfzy960.jpg"/>Downlink Synchronization test:650) this.width=650; "title=" 10.png "src=" http://s3.51cto.com/wyfs02/M01/70/26/wKiom1WyWLjyDTzgAADFFSvZryE364.jpg "alt=" Wkiom1wywljydtzgaadffsvzrye364.jpg "/>For security reasons, it is best to allow only read-o
In linux, ssh + rsyncssh remote login sftp file sharing is similar to ftpsshsecurefiletransferclientscp file sharing, which is similar to cpwww.2cto. comssh configuration file/etc/ssh/sshd_config # change PermitRootLoginyes to no... in linux, configure ssh + rsync ssh remote logon sftp file sharing, similar to ftp ssh secure file transfer clientscp file sharing,
backup.sh, which reads as follows:
The code is as follows
Copy Code
#!/bin/shRsync=/usr/local/bin/rsyncSsh=/usr/bin/sshKey=/home/localuser/.ssh/id_rsaRuser=remoteuserRhost=remotehostRpath=/remote/dirLpath=/this/dir$RSYNC-az-delte-e "$SSH-i $KEY" $RUSER @ $RHOST: $RPATH $LPATH
The-a option is equivalent to option-rlptgod. In simple terms, this option can be recursive to synchronize almost everything in the past,
transmission efficiency enable service editing /etc/xinetd.d/rsync settings disable = on enable default do not enable restart xinetd process service xinetd restart example Week 1 to Week 6 do a backup crontab-e0 2 * * 1-6/usr/bin/rsync-arhz--delete [Emailprotected]:/web /backup nbsp Copy the Web directory of another host to the back of this machine -a Keep file properties-r subdirectory recursive pro
Rsync: Remote synchronization, you can synchronize data locally, will not overwrite the previous data, but the first to determine the existing data and the difference between the new data, only the data will not be the same part of the overlay.# yum Install Rsync.x86_64-yLocal synchronization[Email protected] ~]# rsync-av/etc/passwd/tmp/passwordsending incremental file listpasswdsent 959 bytes received B Yt
Tags: represents classic pat HTML remote host FST verbose targe fstabThere are many data backup tools under Linux, the most used is Rsyns (remote synchronization)Synchronizing Remote data like SCPSynchronizing Local data like CP[Email protected]:~# rsync/etc/passwd/tmp/1.txtCopy the/etc/passwd file to/tmp and rename it to 1.txtIf you are unfamiliar with rsync, yo
This article describes the whole basic: http://www.2cto.com/os/201308/238733.htmlA few simple memos:1. Ubuntu can be installed under Apt-get;2. configuration file/etc/rsync.conf Default does not exist, need to create manually;3. Ability to activate rsync via daemon xinetd, configure in/etc/default/rsync;4. Server configuration login and password in/etc/rsync.passwd, not necessarily this file, be able to con
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.