Increased IP restrictions using rsync Automatic backup full configuration method _linux

Source: Internet
Author: User
Tags auth file permissions rsync
First, server-side configuration:

Install Rsync
#系统一般是默认安装的
If it is not installed you can go to the installation CD (my system is CentOS4.6 so it is in the \centos\rpms\ directory of the first CD)
#配置/etc/rsyncd.conf

#系统上rsync安装后, did not create the rsyncd.conf document, the author is the rsyncd.conf document created by myself
[Root@rsync ~]#
Uid=nobody # This option specifies the UID that the daemon should have when the module transmits files. The default value is "nobody".
Gid=nobody # This option specifies the GID that the daemon should have when the module transmits files. The default value is "nobody".
Max Connections=4 # Maximum number of connections is 4
Use Chroot=no # no chroot
Log File=/var/log/rsyncd.log # Logging file
PID FILE=/VAR/RUN/RSYNCD.PID # Process ID File
Lock File=/var/run/rsyncd.lock # Specifies the locking file that supports the Max connections parameter
#auth Users=root

Hosts allow = 192.168.100.90 # which computers can access the Rsync service
Hosts Deny = 192.168.100.0/24 # which computers are not allowed to access the Rsync service

[Postfix] # Here is the Certified module name, which needs to be specified on the client side
Path=/var/mail # need to do a mirrored directory
Comment = Backup Mail # comment
Ignore errors # Ignores some irrelevant IO errors
Read Only = yes # reading only
List = no # does not allow column files
Auth users = postfix # Specify user
Secrets File=/etc/rsyncd.pwd # Authentication file name, mainly save user password, permissions set to 600, owner root, or client will error

Password file
Generate a password file on the server side/ETC/RSYNCD.PWD
[Root@rsync ~]# Echo postfix:xxx >>/etc/rsyncd.pwd
[Root@rsync ~]# chmod 600/etc/rsyncd.pwd

Start rsync
[Root@rsync ~] #rsync –daemon
[Root@rsync ~] #echo "Rsync–daemon" >>/etc/rc.d/rc.local #添加到自启动文件

Check rsync
[Root@rsync ~] #netstat-na | grep 873 #rsync The default is 873 port, unless special circumstances, generally do not modify
TCP 0 0 0.0.0.0:873 0.0.0.0:* LISTEN
TCP 0 0::: 873:::* LISTEN

Second, the client configuration:

#在本机生产密码文件
[root@client ~] #echo XXX >>/etc/rsyncd.pwd # rsync server postfix password (note: As long as the password)

#客户端备份服务器上指定模块中的数据
[root@client ~] #rsync-vzrtopg–progress–delete–password-file=/etc/rsync.pas postfix@192.168.100.1::p ostfix/home/ mail/#备份rsync服务器上postfix中模块指定文件夹 and delete content that is not on the local server
#-v,–verbose Verbose mode output
#-z,–compress compression of backed-up files on transfer
#-r,–recursive in recursive mode for subdirectories
#-t,–times Keep file time information
#-o,–owner Keep file owner information
#-p,–perms Keep file permissions
#-g,–group Keep file group information
#–progress Display Transfer Progress
#–delete deletes files that are not in the specified directory of the server module in the local backup directory
#–password-file the password from the specified file

#制定计划任务
[Root@client ~] #crontab-E
0 0 * * * Rsync-vzrtopg–progress–delete–password-file=/etc/rsync.pas postfix@192.168.100.1::p ostfix/home/mail/


Windows related software download address:
Http://www.jb51.net/softs/16779.html
Http://www.jb51.net/softs/16780.html

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.