Simple Application of Rsync In Debian

Source: Internet
Author: User
The simple application of Rsync under Debian-the Linux Release Technology-Debian information. The following is a detailed description. First, install the rsync software. As shown in the following example, debian is the easiest to install:
Aptitude install rsync

After installation, rsync is disabled by default. You need to open it in the/etc/default/rsync file. This file is a specific debian setting. You can enable or disable rsync to run in the service mode, and configure the IP address of the Service port. You can only enable the server (192.168.11.24.

You only need to open the service on the vpn address 192.168.11.24. Do not use the default port. The/etc/defaule/rsync file is as follows:

RSYNC_ENABLE = true
# RSYNC_CONFIG_FILE =
RSYNC_OPTS = '-- address = 123.45.67.89 -- port = 100'

Configure/etc/rsyncd. conf on the machine 192.168.11.24, set the rsync service directory provided, and the ip addresses that can be accessed, and the local account corresponding to the remote user.

[Home]
Path =/home
Comment = home directory
Use chroot = true
Uid = 0
Gid = 0
Host allow 192.168.11.2

The password setting file/etc/rsync. pass should be available on both machines.

The content is as follows:
Username: password

The setting is complete. Run the rsync service at 192.168.11.24.

/Etc/init. d/rsync start

Then you can run the following script file in 192.168.11.2 to synchronize the file. You can put the script in/etc/crontab to perform regular operations.

#! /Bin/bash
Rsync -- progress -- recursive -- links -- hard-links -- times -- verbose \
-- Compress -- delete \ rsync: // username@192.168.11.24: 10001/home/home1/192.168.11.24/home \ -- password-file =/etc/rsync. pass

Rsync can be compressed for transmission. If it is synchronized on the LAN, you can remove -- compress to disable the compression function.

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.