Using putty to perform the rsync command

Source: Internet
Author: User



Background introduction:
The company's file server has multiple, one master server and 10 or so slave servers.



When files in the master server are updated, the files in the slave server must also do the corresponding synchronization operations.



The company is currently using Rsync synchronization, but synchronization time is inconsistent, so when the server update, it is necessary to manually synchronize each slave server.



To automate this step, you have the following script:


 
 
@echo off

echo Rsync 10.10.0.100 (server1)...
plink 10.10.0.100 -l root -pw server1Passwd rsync -avzP --password-file=/etc/rsync.password  [email protected]10.10.0.1::down /home/website.com/public_html
echo .
echo Rsync 10.10.0.101 (server2)...
plink 10.10.0.101 -l root -pw server2Passwd rsync -avzP --password-file=/etc/rsync.password  [email protected]10.10.0.1::down /home/website.com/public_html
echo .
echo Rsync 10.10.0.102 (server3)...
plink 110.10.0.102 -l root -pw server3Passwd rsync -avzP --password-file=/etc/rsync.password  [email protected]10.10.0.1::down /home/website.com/public_html
echo .

pause 


Configuration Description:



Rsync.password: Is the password file used by the Rsync client



Downsync: Is the sync account that is allowed on the rsync server side



Putty Official Website: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Note: When the above command executes, use Plink.exe, please put the script and Plink.exe in the same folder to execute



Using putty to perform the rsync command


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.