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

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

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

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

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