Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Backup deployment rsync-- daemon and summary of problems encountered

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This article is part of the system build

Hardware environment:

All IBM3650M4 servers Two nginx_proxies, two web_servers, nfs, DB, backup

System environment:

Operating system is Centos 6.5, rsync version 3.0.6

Purpose: Deploy the rsync --daemon process for backup files

Server:

1. Installation (PC/Server requires rsync command)

The system comes with rsync command. If you need to install it, please use the following command:

yum install -y rsync

2. Create rsync --daemon process user

useradd rsync -s /sbin/nologin -M

3. Create the folder backup used by the rsync --daemon process, and specify that the file belongs to the primary group as the rsync --daemon process user. (Because it is a backup service, I use backup, which can be specified in the configuration file)

mkdir /backup

chown -R rsync.rsync

4, Create rsync configuration file,/etc/rsyncd.config

vim /etc/rsyncd.config

uid = rsync gid = rsyncuse chroot = false max connections = 6 strict modes =yes#port = 873 pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.lock log file = /var/log/rsyncd.log[backup] path = /backup/comment = This is a all host backup ignore errorsread only = falselist = falseauth users = rsync_backupsecrets file = /etc/rsync.passwordhosts allow = 172.16.100.0/24hosts deny = 0.0.0.0/0log file = /var/log/backup_rsyncd.log

Note: Log file contains two entries, but in different locations. Log file is written outside and inside the [backup] module, and the logs recorded are different; another problem is that when log file is written outside the module, rsync --daemon will create rsync.log file when it starts, and record rsync startup log, otherwise it will not. Logs are generated only when files are synchronized.

5. Create the "auth_users user" and password used for authentication, and modify the permission to 600.

vim /etc/rsync.password

rsync_backup:111111

chmod 600 /etc/rsync.passwd

Start rsync --daemon

rsync --daemon

Client:

1. Create the password file required for rsync authentication, and modify the permission to 600.

vim /etc/rsync.password

11111

chmod 600 /etc/rsync.password

2. Start synchronization command and specify password file

rsync -az file rsync_backup@172.16.100.6::backup --password-file=/etc/rsync.password

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report