File Sync backup from linux to linux

Source: Internet
Author: User
Tags redmine testlink man rsync
Rsync file sync backup from linux to linux I. server (server) for which the environment needs to back up files: 192.168.1.201 (RHEL5) server (client) for receiving backup files: 192.168.1.202 (CENTOS5) II. installation and configuration 1. server Configuration A, using... rsync file sync backup from linux to linux I. server (server) for which the environment needs to back up files: 192.168.1.201 (RHEL 5) server (client) for receiving backup files ): 192.168.1.202 (CENTOS 5) II. installation and configuration 1. server Configuration A. Use rsync installed by default to edit/etc/rsyncd. conf file. if not, create a new one. Vi/etc/rsyncd. conf # [globale] strict modes = yes # check passwd fileport = 873 # default portlogfile =/var/log/rsyncd. logpidfile =/var/run/rsyncd. pidmax connections = 4 # [modules] [testlink] # backup module uid = rootgid = rootpath =/usr/local/apache/htdocs/testlink/upload_area # read only = nohost allow = * auth users = wwyhysecrets file =/etc/rsyncd. scrt [bugfree] # backup module uid = rootgid = rootpath =/usr/local/apache/htdocs/bugfree/BugFile # directory to be backed up read only = nohost allow = * auth users = wwyhysecrets file =/etc/rsyncd. scrt [redmine] # backup module uid = rootgid = rootpath =/usr/local/redmine-0.8.1/files # directory to be backed up read only = nohost allow = * auth users = wwyhysecrets file =/ etc/rsyncd. scrt B. add a password file vi/etc/rsyncd. scrt content: wwyhy: 123456 # (set by yourself) C. change the permission to 600 chmod 600/etc/rsyncd. scrt D. start the service (if a firewall is enabled, allow port 873 to pass through) rsync -- daemon -- config =/etc/rsyncd. conf & 2.configure the client I will compile the installation of rsync-3.0.3.tar.gz A, installation: tar-zxvf rsync-3.0.3.tar.gzcd. /configuremakemake installB and add the password file vi/etc/rsyncd. the content of scrt (New if not available) is as follows: wwyhy: 123456 (the file is the same as the client file content) C. change the file permission to 600 chmod 600/etc/rsyncd. scrt 3. you can run the man rsync command on the client to view the backup command. We use scripts to automatically execute the backup column: rsync-avz -- password-file = password file path username @ host IP address to be backed up :: the module name in the backup receives the path of the backup file. create a script file vi backup in/root and add the following content: # backup command rsync-avz -- password-file =/etc/rsyncd for testlink attachment on 1.192.168.1.201. scrt wwyhy@192.168.1.201: testlink/home/wangwei/testlink/upload_area # bugfree attachment backup command on 2.192.168.1.201 rsync-avz -- password-file =/etc/rsyncd. scrt wwyhy@192.168.1.201: bugfree/home/wangwei/bugfree/BugFile # redmine attachment backup command on 3.192.168.1.201 rsync-avz -- password-file =/etc/rsyncd. scrt wwyhy@192.168.1.201: redmine/home/wangwei/redmine-0.8.1/files chmod u + x backup 2.30 automatic execution per night vi/etc/crontab 30 2 *** root/backup
Related Article

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.