Linux Server Setup--rsync

Source: Internet
Author: User
Tags log log root access rsync

RSNC Remote Sync
Installation package: rsync-3.0.6-4.el5_7.1.x86_64.rpm

RPM-IVH rsync-3.0.6-4.el5_7.1.x86_64.rpm

The local mode only needs to install Rsync:
Rsync-av/secbox/backup Backup to Local
Rsync-a/backup View a list of local files

Remote Shell mode: Serves as a server for disaster recovery: Service xinetd Start
On client operations:
Rsync-ava/secbox 192.168.1.12::backup Backup to remote
Rsync-a 192.168.1.12::backup View Remote list

Server mode: Requires data backup for the server,/usr/bin/rsync--daemon
On client operations:
/USR/BIN/RSYNC-VZRTOPG--delete--progress--exclude "*access*"--exclude "debug*" [email protected]:: IXDBA /backup--password-file=/etc/server.pass

Native shell mode ****************

Rsync-av License/backup

Rsync-av license//backup (license directory not included)

Remote Shell Mode ****************

Set up a remote backup server
1. Planning Catalog
/dev/sdb1/backup
2.vi/etc/xinetd.d/rsync
Service rsync
{
Disable = No default is yes,no means open
Socket_type = stream using a TCP connection
Wait = no can make a large number of simultaneous connections
user = root starts the service as root
Server =/usr/bin/rsync Service process path
Server_args =--daemon Initiates rsync as a daemon
Log_on_failure + = USERID Login error, record user ID
}
3.vi/etc/rsyncd.conf
UID = root User ID
GID = root Group ID
Use chroot = no no need to change
Max connections = 4 Maximum number of connections
Port = 873 Listening ports
Log file =/var/log/rsyncd.log log files
PID file =/var/run/rsyncd.pid Writes the running process ID to the file
Lock file =/var/run/rsyncd.lock is used to synchronize backup requests for simultaneous connections.
[Backup] Warehouse name, only for this
Path=/backup Backup data storage location, must exist
Read Only = False close read-only, can write-that is, backup
List = True if the file list is listed when the client requests
Secret file =/home/rsyncd.secrets do not add this line if no password is required, with fourth step, this is not required for KMJ remote backup


4.service xinetd Restart (must be turned on.) No xinetd required to install)

5. Turn off SELinux and iptables


operate on a server that needs to back up data
RSYNC-AV License 192.168.1.11::backup
Rsync-ava/secbox 192.168.1.12::backup

Rsync list Mode ****************

Rsync-a 192.168.1.11::backup View the contents of the Remote host directory (default as root access,:: After the warehouse name, you need to enter the root password)


Rsync-a/tmp/license View Local directory contents


Server Mode ****************

A for the host that needs to back up the data, run the Rsync service as a server
B is the client for the disaster recovery backup, and the server mode operates on the B side.

A server:
Installing rsync
Touch/etc/rsyncd.conf
Vi/etc/rsyncd.conf
[Email protected] etc]# cat/etc/rsyncd.conf
UID = nobody
GID = Nobody
Use chroot = no
Max Connections =10
Strict modes = yes
PID file =/var/run/rsyncd.pid
Lock file =/var/run/rsync.lock
Log file =/var/log/rsyncd.log

[IXDBA]
Path =/secbox/cipher
Comment = Ixdba file
Ignore errors
Read Only = no
Write only = no
Hosts allow = *
Hosts Deny =
List = False
UID = root
GID = root
Auth users = Backup
Secrets file =/etc/server.pass

Touch/etc/server.pass
Vi/etc/server.pass
[Email protected] etc]# Cat/etc/server.pass
Backup:ixdba123
chmod 600/etc/server.pass

/usr/bin/rsync--daemon
PS aux |grep rsync

B Disaster Recovery backup client:
Installing rsync

Touch/etc/server.pass
Vi/etc/server.pass
[Email protected] etc]# Cat/etc/server.pass
Backup:ixdba123


/USR/BIN/RSYNC-VZRTOPG--delete--progress--exclude "*access*"--exclude "debug*" [email protected]:: IXDBA/ Backup--password-file=/etc/server.pass

Scheduled backups:
Crontab-e
3 * * */USR/BIN/RSYNC-VZRTOPG--delete--progress--exclude "*access*"--exclude "debug*" [email protected]: : Ixdba/backup--password-file=/etc/server.pass


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.