Rsync intranet server Push and pull public network code configuration

Source: Internet
Author: User
Tags rsync


First, on the Web (Web install rsync does not need to configure rsyncd.conf), Web_bak install rsync (the Web updates the information under/var/www/html/, and then updates all data under the Wen_bak/var/www/html/)

ip:192.168.1.80 is the source server is the service side (Yum installs rsync on line, do not need to configure), 192.168.1.81 is the destination server is the client (Yum installs Rsync, also configures/etc/rsyncd.conf).

[email protected] ~]# yum-y Install rsync

Second, configure Web_bak rsync

[[Email protected]_bak]#vim/etc/rsyncd.conf  ## Configuration files need to be created manually
# rsync
UID = nobody
GID = Nobody
Use chroot = no
Max connections = 10
PID file =/var/run/rsyncd.pid
Lock file =/var/run/rsyncd.lock
Log file =/var/run/rsyncd.log
[Web1]
Path =/var/www/html/(the client's path is not the same as the service side, self-determined)
Comment = Web_bak file
Ignore errors
Read Only = no
Write only = no
List = False
UID = root
GID = root
Auth users = root
Secrets file =/etc/rsyncd.pass
[[Email protected]_bak]#echo "root:123456" >/etc/rsyncd.pass
[[Email protected]_bak]#chown Root.root/etc/rsyncd.pass
[[Email protected]_bak]#chmod 600/etc/rsyncd.pass

Third, start rsync with the daemon and join the boot

[[Email protected]_bak]#rsync--daemon
[[Email protected]_bak]#PS aux | greprsync
Root 1344 0.1 0.0 107612 660? Ss 19:17 0:00 rsync--daemon
Root 1347 1.0 0.1 103240 864 pts/0 s+ 19:17 0:00 grep rsync
[[Email protected]_bak]#which rsync
/usr/bin/rsync
[[email protected]_bak]# echo " /usr/bin/rsync--daemon ">>/etc/rc.d/rc.local
[[email  protected]_bak]# iptables-i input-p tcp--dport 873-j ACCEPT
[email protected]_bak]# service iptables Save
[[email protected]_bak]# Service iptables restart

[[email protected] ~]# echo "123456" >/etc/rsyncd.pass    # Note there is no user password in the password file, the format is different from Web_bak
[[email protected] ~]# chown root.root/etc/rsyncd.pass
[[email protected] ~]# chmod 600/ Etc/rsyncd.pass

On the source server, run the test :

Pull from server side (180)

/usr/bin/rsync-avz--progress--password-file=/etc/rsync.pass [email protected]::test/www/test

Web server Push

/usr/bin/rsync-avz--progress--password-file=/etc/rsync.pass/www/test [email protected]::test



This article is from the "System website Operations" blog, please be sure to keep this source http://cgc888.blog.51cto.com/3989433/1717544

Rsync intranet server Push and pull public network code configuration

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.