数据备份之–rsync
发表于:2024-10-28 作者:千家信息网编辑
千家信息网最后更新 2024年10月28日,软件版本:rsync-3.0.9服务器端配置>需要安装xinetd服务yum install xinetd -y #rhelapt-get install xinetd -y #ubuntu>安装wg
千家信息网最后更新 2024年10月28日数据备份之–rsync
软件版本:rsync-3.0.9
服务器端配置
>需要安装xinetd服务
yum install xinetd -y #rhel |
apt-get install xinetd -y #ubuntu |
>安装
wget http://rsync.samba.org/ftp/rsync/rsync-3.0.9.tar.gzwget http://rsync.samba.org/ftp/rsync/rsync-patches-3.0.9.tar.gztar zxvf rsync-3.0.9.tar.gztar zxvf rsync-patches-3.0.9.tar.gzcd rsync-3.0.9./configuremake && make install |
1.创建配置文件
vim /etc/rsyncd.conf |
; port=873uid=rootgid=rootmax connections=10log file=/var/log/rsyncd.logpid file=/var/run/rsyncd.pidlock file=/var/run/rsyncd.locksecrets file=/etc/rsyncd.passwd; hosts allow=192.168.11.0/27; hosts deny=192.168.11.0/255.255.255.224timeout=600 [backdir]comment= for client backpath=/home/backdir/read only = no;exclude=test;exclude from=/path/to/file;include from=/path/to/fileauth users=caide.me[share]comment= backup share filepath=/home/share/read only = yesauth users=caide.me |
2.创建密码文件(/etc/rsyncd.passwd)
echo "caide.me:caide.me.passwd" > /etc/rsyncd.passwdchmod 600 /etc/rsyncd.passwd |
3.创建xinetd监听任务(/etc/xinetd.d/xinetd_rsync)
vim /etc/xinetd.d/xinetd_rsync |
# default: off# description: The rsync server is a good addition to an ftp server, as it \# allows crc checksumming etc.service rsync{ disable = no socket_type = stream wait = no user = root server = /usr/local/bin/rsync server_args = --daemon log_on_failure += USERID} |
service xinetd restart |
->如有需要,防火墙需开启tcp协议873端口<--
客户端配置
>安装
wget http://rsync.samba.org/ftp/rsync/rsync-3.0.9.tar.gzwget http://rsync.samba.org/ftp/rsync/rsync-patches-3.0.9.tar.gztar zxvf rsync-3.0.9.tar.gztar zxvf rsync-patches-3.0.9.tar.gzcd rsync-3.0.9./configuremake && make install |
备份-还原文件shell脚本
#!/bin/sh# 按照IP进行备份NICS=`arp -a | awk '{print $7}'`NIC=`echo $NICS |awk '{print $1}'`SERVERIP=`ifconfig $NIC | awk '/inet / {print $2}' | cut -f2 -d ":"`# directory to backupBDIR=/path/to/backdir# excludes file - this contains a wildcard pattern per line of files to excludeEXCLUDES=no_rsync.txt# the name of the backup machineBSERVER=back_server_ipif [ "$SERVERIP" = "$BSERVER" ]thenexitfi# your password on the backup serverUSERNAME=caide.meexport RSYNC_PASSWORD=caide.me.passwd########################################################################MODULE=backdirOPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES--delete -avz"export PATH=$PATH:/bin:/usr/bin:/usr/local/bin# now the actual transferrsync $OPTS $BDIR $USERNAME@$BSERVER::$MODULE/$SERVERIP #备份# rsync $OPTS $USERNAME@$BSERVER::$MODULE/$SERVERIP $BDIR #还原
备份
文件
配置
服务
任务
客户
客户端
密码
服务器
版本
端口
脚本
软件
防火墙
监听
防火
数据
数据备份
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
义乌网络安全课程免费试学
服务器 多个网站
计算机网络技术精讲ppt
schema数据库怎么导进去
软件开发业务组
广东计算机应用软件开发价格表
数据库表格中不能填一样的数字
京峰教育网络安全学习材料
护苗网络安全课ppt课件
数据库软件orecal
甘肃服务器机柜推荐
有软件开发经历怎么证明
无限法则服务器都关闭了吗
数据库多并发控制
流媒体服务器系统
odbc数据库管理客户端
view 安全服务器安装
海信传媒网络技术有限公司
常熟数据网络技术咨询热线
第七届网络安全知识竞赛
能删除数据库emp的语句
苏州入门级戴尔服务器
纸贵互联网科技
服务器网络连接配置
赤峰网络技术有什么公司
手机服务器特性
文件服务器存在exe文件
什么职业的人需要买服务器
网络技术服务工程师面试
35岁想改行做网络安全工程师