搭建backup服务器rsyncdaemon服务模式之二rsync客户端配置

1.检查客户端是否有rsync服务:

[[email protected] ~]# rsync --version
rsync  version 3.0.6  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.
[[email protected] ~]# rpm -qa rsync
rsync-3.0.6-12.el6.x86_64

2.客户端编辑/etc/rsync.password留下密码oldboy

[[email protected] ~]# echo "oldboy" >/etc/rsync.password
[[email protected] ~]# cat /etc/rsync.password
oldboy

因为有密码所以是600全新

[[email protected] ~]# chmod 600 /etc/rsync.password
[[email protected] ~]# ll /etc/rsync.password
-rw------- 1 root root 0 Aug  3 00:43 /etc/rsync.password

3.创建backup目录,目的:打包,推送,删除。本地临时备份目录

[[email protected] ~]# mkdir -p /backup
[[email protected] ~]# cd /backup
[[email protected] backup]# touch stu{01..100}

[[email protected] backup]# ls
stu001  stu011  stu021  stu031  stu041  stu051  stu061  stu071  stu081  stu091
stu002  stu012  stu022  stu032  stu042  stu052  stu062  stu072  stu082  stu092
stu003  stu013  stu023  stu033  stu043  stu053  stu063  stu073  stu083  stu093
stu004  stu014  stu024  stu034  stu044  stu054  stu064  stu074  stu084  stu094
stu005  stu015  stu025  stu035  stu045  stu055  stu065  stu075  stu085  stu095
stu006  stu016  stu026  stu036  stu046  stu056  stu066  stu076  stu086  stu096
stu007  stu017  stu027  stu037  stu047  stu057  stu067  stu077  stu087  stu097
stu008  stu018  stu028  stu038  stu048  stu058  stu068  stu078  stu088  stu098
stu009  stu019  stu029  stu039  stu049  stu059  stu069  stu079  stu089  stu099
stu010  stu020  stu030  stu040  stu050  stu060  stu070  stu080  stu090  stu100

4.推送到服务器端

根据: https://www.samba.org/ftp/rsync/rsync.html

SYNOPSIS

Local:  rsync [OPTION...] SRC... [DEST]

Access via remote shell:
  Pull: rsync [OPTION...] [[email protected]]HOST:SRC... [DEST]
  Push: rsync [OPTION...] SRC... [[email protected]]HOST:DEST

Access via rsync daemon:
  Pull: rsync [OPTION...] [[email protected]]HOST::SRC... [DEST]
        rsync [OPTION...] rsync://[[email protected]]HOST[:PORT]/SRC... [DEST]
  Push: rsync [OPTION...] SRC... [[email protected]]HOST::DEST
        rsync [OPTION...] SRC... rsync://[[email protected]]HOST[:PORT]/DEST

[[email protected] ~]# rsync -avz /backup/ [email protected]::backup/ --password-file=/etc/rsync.password

rsync客户端

1.生成连接服务器需要的密码文件

echo "oldboy" >/etc/rsync.password

cat /etc/rsync.password

2.为密码文件配置权限

chmod 600 /etc/rsync.password

ls -l /etc/rsync.password

3.同步文件

推送:

rsync -avz /tmp/ [email protected]::oldboy --password-file=/etc/rsync.password

rsync -avz /tmp rsync://[email protected]/backup/ --password-file=/etc/rsync.password

拉取:

rsync -avz [email protected]::oldboy /tmp/ --password-file=/etc/rsync.password

rsync -avz rsync://[email protected]/backup/ /tmp --password-file=/etc/rsync.password

提示:上述backup为模块名,不是路径

时间: 2024-08-24 16:42:13

搭建backup服务器rsyncdaemon服务模式之二rsync客户端配置的相关文章

Linux与云计算——第二阶段 第一十一章:代理Proxy服务器架设—Squid代理服务器正向代理和客户端配置

Linux与云计算--第二阶段Linux服务器架设 第一十一章:代理Proxy服务器架设-Squid代理服务器正向代理和客户端配置 安装Squid 安装Squid来配置代理服务器. [1] 这是一个通用的转发代理配置 [[email protected] ~]# yum -y install squid [[email protected] ~]# vi /etc/squid/squid.conf # line 26: 添加一条新的ACL acl lan src 192.168.96.0/24

搭建backup服务器之rsyncdaemon服务模式

deamon方式就是先搭建一个服务器,这个服务器上面跑一个rsync服务,服务就称为deamon(deamon就是实时运行的程序),rsync监听端口是873,然后在客户端上面使用rsync命令,实现和服务器之间推拉动作.(推拉都是在客户端执行rsync命令) 1. 统一版本: [[email protected] ~]# uname -mx86_64[[email protected] ~]# uname -r2.6.32-642.el6.x86_64[[email protected] ~]

搭建DHCP服务器——安装服务

一.安装DHCP服务打开 " 服务器管理器 ",添加DHCP服务器角色.选择向客户端提供服务的网络适配器(网卡)填写当前所在域以及首选和备用DNS服务器设置不需要WINS 服务,继续下一步添加子网中分配给客户端的IP地址范围(在一台DHCP服务器中可以设置多个作用域,在安装DHCP服务的同时会默认并激活创建一个作用域),选择禁用IPv6 无状态模式,下边的默认直到安装完成.到此服务安装完成,接下来我们用客户端测试 二.客户端测试打开 " 虚拟网络编辑器 " ,关闭V

LVS DR模式 RealServer 为 Windows客户端配置

LVS   DR模式  Windows 2000,Windows2003客户端配置 控制面板-添加硬件-选"是,我已经连接了此设备"点击下一步-在列表中选择添加新的硬件设备-选"安 装我充从手动..." -接下来的列表中选择"Microsoft loopback adapter " 添加完成后在"网上邻居"右键 设置Microsoft loopback adapter IP地址,子网掩码要设置成VIP所对应的子网掩码  (不能

Linux搭建SVN服务器(服务端)

1 安装SVN SVN客户端:TortoiseSVN,官网下载:https://tortoisesvn.net/downloads.html(客户端) # yum install subversion: 1.新建一个目录用于存储SVN所有文件 # mkdir /svn 2. 新建一个资源仓库 # svnadmin create /svn/project # ls /svn/project/ conf db format hooks locks README.txt 目录用途说明: * hooks

搭建FTP服务器——安装服务

我们所选择的服务器系统为Windows2008R2 ,本系统中的FTP服务已集成到了IIS7.5的WEB服务中,因此需要通过"服务器管理器"中的"添加角色向导",在"WEB服务器"角色中选择FTP服务器.然后下一步,安装即可. 接下来创建FTP站点系统默认并没有创建FTP站点,默认状态下,IIS 管理器中只有一个Web站点,下面新建一个FTP站点.①单击右侧"操作"面板中的"添加FTP站点"选项, 启动&q

ftp服务器的简单实现(二)——客户端

客户端: #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/stat.h> #include <fcntl.h> #inclu

CentOS7搭建NTP服务器及客户端同步时间

一.服务器配置 1.查看服务器.客户端操作系统版本 [[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) 2.查看服务器是否安装ntp,系统默认安装ntpdate: [[email protected] ~]# rpm -qa | grep ntp fontpackages-filesystem-1.44-8.el7.noarch ntpdate-4.2.6p5-28.el7.cen

linux 搭建CA服务器 http+ssl mail+ssl 扫描与抓包

搭建CA服务器 CA服务是给服务器发放数字证书,被通信双方信任,独立的第三方机构 国内常见的CA机构 中国金融认证中心(CFCA) 中国电信安全认证中心(CTCA) 北京数字证书认证中心(BJCA) PKI公钥基础设施 一套标准的密钥管理平台 通过公钥加密,数字证书技术确保信息安全 PKI体系的基本组成 权威认证机构(CA) 数字证书库,密钥备份及恢复系统 证书作废系统,应用接口 ----------------------------------------------OpenSSL加密工具