当前位置:网站首页>Rsync for file backup
Rsync for file backup
2022-06-24 08:40:00 【An unreliable programmer】
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
[test]
path = /home/back
comment = 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 【test】 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 /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 .
边栏推荐
- jwt(json web token)
- 单目双视三维坐标确定
- Fundamentals of 3D mathematics [17] inverse square theorem
- PHP代码加密+扩展解密实战
- 饼状统计图,带有标注线,都可以自行设定其多种参数选项
- Glusterfs replacement failure brick
- ZUCC_编译语言原理与编译_实验04 语言与文法
- Variable declaration and some special variables in shell
- JS merge multiple objects and remove duplicates
- Blue screen error UNMOUNTABLE boot volume of the solution
猜你喜欢
![[micro services ~nacos] Nacos service providers and service consumers](/img/b7/47ecd6979ccfeb270261681d6130be.png)
[micro services ~nacos] Nacos service providers and service consumers

Permission model DAC ACL RBAC ABAC

Qt 中发送自定义事件

Redis cluster data skew

新技术实战,一步步用Activity Results API封装权限申请库

中国芯片独角兽公司

2021-03-16 comp9021 class 9 notes

日本大阪大学万伟伟研究员介绍基于WRS系统机器人的快速集成方法和应用

12-- merge two ordered linked lists

RCNN、Fast-RCNN、Faster-RCNN介绍
随机推荐
How to mount a USB hard disk with NTFS file format under RHEL5 system
Common misconceptions in Tencent conference API - signature error_ code 200003
Promise usage scenarios
饼状统计图,带有标注线,都可以自行设定其多种参数选项
dataX使用指南
日本大阪大学万伟伟研究员介绍基于WRS系统机器人的快速集成方法和应用
Ordinary token
js中通过key查找和更新对象中指定值的方法
ZUCC_ Principles of compiling language and compilation_ Experiment 08 parsing LR parsing
leetcode 1642. Furthest Building You Can Reach(能到达的最远的建筑)
JS scroll div scroll bar to bottom
Review SGI STL secondary space configurator (internal storage pool) | notes for personal use
Rust procedure macro simply imitates Lombok function
ZUCC_编译语言原理与编译_实验03 编译器入门
Redis的Cluster集群数据倾斜
[xinliu-s6 new model +sa 3-star Xinghai] the new two-way server of the third generation chip was launched and the product was updated~
【微服务~Nacos】Nacos服务提供者和服务消费者
After interviewing and tutoring several children, I found some problems!
One development skill a day: how to establish P2P communication based on webrtc?
ZUCC_ Principles of compiling language and compilation_ Experiment 02 fsharp Ocaml language