标签:let roo ack name hostname min host server 备份
2.全网备份# 01: 验证备份数据完整性
find /backup/ -type f -name "finger.txt"|xargs md5sum -c >/tmp/check_finger.txt
# 02: 将指纹文件验证结果发送给运维人员
mail -s "$(date +%F) data check" 330882721@qq.com </tmp/check_finger.txt
# 03: 删除历史备份数据(180天前)
find /backup -type f -mtime +180 ! -name "*星期1.tar.gz" -delete
2.2.2.客户端部署
#!/bin/bash
IP_info=$(hostname -i)
# 01. 创建备份目录
mkdir -p /backup/$IP_info/
# 02. 备份数据信息(压缩备份)
echo oldboy66 >/etc/sysconfig/iptables
tar zchPf /backup/$IP_info/system_data_$(date +%F_星期%w).tar.gz /var/spool/cron/root /etc/rc.local /server/scripts /etc/sysconfig/iptables
# 03. 生成指纹文件信息
find /backup/$IP_info/ -type f -mmin -15|xargs md5sum >/backup/$IP_info/finger.txt
# 04. 将数据文件进行备份传输
rsync -az /backup/$IP_info/ rsync_backup@172.16.1.41::backup/$IP_info/ --password-file=/etc/rsync.password
# 05. 删除7天以前备份数据信息
find /backup -type f -mtime +7 -delete
标签:let roo ack name hostname min host server 备份
原文地址:https://blog.51cto.com/14526656/2460702