当前位置:网站首页>Rsync synchronous backup
Rsync synchronous backup
2022-06-09 05:24:00 【Anonymous s】
rsync
rsync yes linux Data image backup tool under the system . Use the fast incremental backup tool Remote Sync Remote synchronization is possible , Support local replication , Or with others SSH、rsync Host synchronization .
You can mirror the entire directory tree and file system .
It's easy to keep the permissions of the original file 、 Time 、 Hard and soft links and so on .
You can install without special permission .
Fast : The first synchronization rsync It copies everything , But the next time only the modified files are transferred .rsync In the process of data transmission, compression and decompression operations can be implemented , So you can use less bandwidth .
Security : have access to scp、ssh And so on to transfer files , Of course, it can also be done directly socket Connect .
Support anonymous transmission , In order to facilitate the website mirror image .
rsync install
- download (2018 year 9 month 25 Japan 13:52:23 The latest version is 3.1.3)
wget https://download.samba.org/pub/rsync/src/rsync-3.1.3.tar.gz - decompression
tar -xvf rsync-3.1.3.tar.gz - Enter the unzipped directory
- To configure
./configure --prefix=/usr/local/rsync/ - compile
make - install
make install
Configure server conf
vi /etc/rsyncd.conf
Modify the following content according to your own situation and then copy it
# Minimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help
# This line is required by the /etc/init.d/rsyncd script
uid = root
gid = root
use chroot = false # Is it limited to this directory , The default is true, When there is a soft connection , Need to be changed to fasle, If true Limit it to the default directory of the module
read only = yes # Is it read-only , If it is no Words , The customer service end fails to push to the service end , It should be changed to yes
#limit access to private LANs
hosts allow= # Client address
hosts deny=*
max connections = 5
#This will give you a separate log file
log file = /mnt/log/rsync.log
#This will log every file transferred - up to 85,000+ per user, per sync
transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 900
ignore nonreadable = yes
dont compress = .gz .tgz .zip .z .Z .rpm .deb .bz2
[nick]
path = /home/wwwroot
comment = mms files backup
list=no
ignore errors
auth users = root
secrets file = /usr/local/rsync/rsyncd.secrets
#exclude =
Configure the server user password file
vi rsyncd.secrets
Here, you only need to match the configuration file 【mms】 In the module secrets file The corresponding configuration items are consistent
The format of the content is user name : password
for example root:root123
Permission to modify user password file
chmod 600 /usr/local/rsync/rsyncd.secrets
Start the server program , Run in daemons mode
Get into bin Catalog , perform ./rsync --daemon You can start
You can confirm the successful startup by checking the port number netstat -antp|grep 873
About how to restart the server daemon
direct kill Drop the process and restart it , It is so violent
The client performs synchronization test
rsync -vzrtlopg --progress [email protected] Server side IP:: Module name (nick) /path/ --password-file=/etc/rsyncd.passwd
Command parsing :
-v, --verbose Detailed mode output .
-z, --compress Compress the backup files during transmission .
-r, --recursive Deal with subdirectories in recursive mode .
-t, --times Keep file time information .
-l, --links Keep the soft links .
-o, --owner Keep file owner information .
-p, --perms Keep file permissions .
-g, --group Keep file group information .
Because what we do is redundant active and standby , So don't add --delete Delete those DST in SRC No documents .
If you need to do a full synchronization , You need to add --delete command , That is, the files deleted by the server , The client will also delete .
Scheduled backup
Add the above command to the scheduled task , You can achieve daily standby .
Step on the hole guide
1. Daemon mode must be started with --daemon Parameters
2. If the password of the client is also stored in the file , As shown above , Note that the client password file is different from the server password file , The client does not need a user name , Just a password .
边栏推荐
- 2022年茶艺师(中级)考试题模拟考试题库及模拟考试
- pytorch DDP加速之gradient accumulation设置
- Cloud computing technology
- Test question bank and online simulation test for operation certificate of main principals of hazardous chemical business units in 2022
- Marathon环境下fastdfs和vsftpd和miniIo文件服务器搭建的方式
- Data summit 2022 conference information sharing (23 in total)
- Article title
- Web page capture software
- Previous improvements of CSDN products (up to issue 29)
- MQ message loss, message consistency, repeated consumption solution
猜你喜欢

1030. distance sequence matrix cells ●

wps ppt背景图片如何换颜色

Design idea of three party account authorization login system
![[it] Foxit PDF retention tool selection](/img/1e/87dbd435e830c139bc3d5cf86d6d57.png)
[it] Foxit PDF retention tool selection

内网渗透 - 哈希传递攻击

Windows uses php to start ThinkPHP project and deploy configuration

ETF operation practice record: March 2, 2022

wps ppt图片如何一张一张出来
![Typescript learning [7] advanced types: Union type and cross type](/img/c7/91d104f948cb5c7f5d33854ca374d1.png)
Typescript learning [7] advanced types: Union type and cross type

Transaction code qc51 of SAP QM preliminary level creates quality certificate for purchase order
随机推荐
由id获取name调用示例(腾讯IM)
SQL summary statistics: use cube and rollup in SQL to realize multidimensional data summary
Transaction code qc51 of SAP QM preliminary level creates quality certificate for purchase order
Simple process and problem handling of cmdbuilding
Web page capture software
Product weekly report issue 29 | creation center optimization: the sending assistant adds the quality score detection function, and the blog adds the historical version of the content
June 2022 Tsinghua Management Tsinghua University Ning Xiangdong
Data summit 2022 conference information sharing (23 in total)
【IT】福昕pdf保持工具選擇
Failed to crawl HTML into MySQL insert
Camtasia studio2022 free key serial number installation trial detailed graphic tutorial
wps ppt图片如何一张一张出来
Analysis of semaphore source code of AQS
groupby函数详解
关于istream输入流对象cin的输入函数
queue
pytest_ Introduction to allure priority and fixture scope parameters
2021 national vocational skills competition Liaoning "Cyberspace Security Competition" and its analysis (ultra detailed)
AQS 之 Semaphore 源码分析
Typescript learning [6] interface type