Get the App
SLTechnology News&Howtos  ›  Servers  › 

The most basic Integrated Architecture Construction and deployment process-- rsync and Network-wide backup

Shulou Source: shulou.com Published: 2022-06-02 08:34:26 10月05日 Update

1.rsync service

1.1 the role of backup services

Uniformly store and backup the data in the data server to one server

1.2.installation and deployment of rsyncMury-service

The deployment process of rsync is server side and client side.

1.2.1. Server deployment

The first course: installing software programs

Yum install-y rsync

The second course: writing configuration files

Vim / etc/rsyncd.conf

The third course: creating virtual user information

Useradd-M-s / sbin/nologin rsync

The fourth course: creating password files

Echo "rsync_backup:oldboy123" > / etc/rsync.password

Chmod 600 / etc/rsync.password

The fifth course: creating a backup data directory

Mkdir / backup-p

Chown rsync.rsync / backup/-- ps: modify directory owners and groups to map the names of owners and groups the same as virtual users

The sixth course: start the service program

Systemctl start rsyncd

Systemctl enable rsyncd

1.2.2. Client deployment

The first course: testing backup data

Rsync-avz / etc/hosts rsync_backup@172.16.1.41::backup

The second course: the realization of interactive backup of data

Echo oldboy123 > / etc/rsync.password

Chmod 600 / etc/rsync.password

Rsync-avz / oldboy/ rsync_backup@172.16.1.41::backup-- password-file=/etc/rsync.password

two。 Full network backup

2.1. The role of network-wide backup

This project can uniformly back up the data files and directories to the backup server by scripting the data from the web server and the storage server, and then remind the user by legal mail.

2.2. Network-wide backup deployment process

2.2.1. Server deployment

#! / bin/bash

# 01: verify backup data integrity find / backup/-type f-name "finger.txt" | xargs md5sum-c > / tmp/check_finger.txt# 02: send fingerprint file verification results to operation and maintenance personnel mail-s "$(date +% F) data check" 330882721@qq.com / etc/sysconfig/iptablestar zchPf / backup/$IP_info/system_data_$ (date +% Fweek% w). Tar.gz / var/spool / cron/root / etc/rc.local / server/scripts / etc/sysconfig/iptables# 03. Generate fingerprint file information find / backup/$IP_info/-type f-mmin-15 | xargs md5sum > / backup/$IP_info/finger.txt# 04. Backup and transfer the data files to rsync-az / backup/$IP_info/ rsync_backup@172.16.1.41::backup/$IP_info/-- password-file=/etc/rsync.password # 05. Delete data information backed up 7 days ago find / backup-type f-mtime + 7-delete

Tags: Backup data service course file server information directory whole network client client user process function fingerprint mode week program storage unification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi MySQL OPPO Reno Huawei