liunx 安装rsync
新建一个rsync.s文件,把下面的代码写入文件里:
#!/usr/bin/env bash
mkdir -p /data/app/rsync/etc/
mkdir -p /data/logs/rsync/
mkdir -p /data/download/
mkdir -p /data/www/test/
cd /data/download
wget https://download.samba.org/pub/rsync/src/rsync-3.1.3.tar.gz
tar zxvf rsync-3.1.3.tar.gz
cd rsync-3.1.3
./configure --prefix=/data/app/rsync
make && make install echo 'wzb:123456' > /data/app/rsync/etc/rsyncd.secrets
chmod 600 /data/app/rsync/etc/rsyncd.secrets cat > /data/app/rsync/etc/rsyncd.conf <<EOF
max connections = 5
# 基本配置,注意uid和gid需要是root,否则无法指定目标文件的所属用户和所属组
secrets file = /data/app/rsync/etc/rsyncd.secrets
read only = no
write only = no
list= yes
uid = root
gid = root
max connections = 5
hosts allow = *
#hosts deny = *
use chroot = no
log file = /data/logs/rsync/rsyncd.log
pid file = /var/run/rsyncd.pid
# 设置访问的用户必须为rsync,这个用户是虚拟的,不需要在系统中创建这个用户。客户端进行推送的时候指定即可
auth users = wzb
# 设置密码文件位置,这里保存了rsync用户的密码
secrets file = /data/app/rsync/etc/rsyncd.secrets
# 配置一个模块,一个模块就是一个可以进行同步的目录,可以配置多个模块意味着接受多个目录的同步请求,模块名是随意起的,客户端在发起同步时需指定模块名
[test]
path = /data/www/test
# 设置访问的用户必须为rsync,这个用户是虚拟的,不需要在系统中创建这个用户。客户端进行推送的时候指定即可
auth users = wzb
# 设置密码文件位置,这里保存了rsync用户的密码
secrets file = /data/app/rsync/etc/rsyncd.secrets
EOF #添加开机启动
cat > /data/app/rsync/rsync_service.sh <<EOF
#!/bin/bash
/data/app/rsync/bin/rsync --daemon --config=/data/app/rsync/etc/rsyncd.conf
EOF chmod +x /data/app/rsync/rsync_service.sh cat >> /etc/rc.local <<EOF
/data/app/rsync/rsync_service.sh
EOF
if [[ $? == 0 ]]; then
echo -e "\n==========rsync安装成功==========\n\n"
else
echo -e "\n==========rsync安装失败!==========\n\n"
exit 0
fi
客户端上传文件列子:
rsync -avzP --exclude-from=exclude.txt ./ wzb@116.**.1**.**5::test --chown=www:www --progress --password-file=/etc/waptest_tp5.txt
rsync -avzP --exclude-from=exclude.txt ./ wzb@116.**.1**.**5::test --chown=www:www --progress --delete --password-file=/etc/waptest_tp5.txt
#/etc/waptest_tp5.txt 密码文件
#exclude.txt 过滤文件
#--delete 参数为完全同步
下载文件列子:
rsync -avz --exclude-from=exclude.txt wzb@4*.**.**.1*1::test ./
liunx 安装rsync的更多相关文章
- windows安装rsync
客户端:cwRsync 4.0.5 Installer 服务端:cwRsyncServer 4.0.5 Installer 安装配置Rsync服务端 1.直接双击安装包安装即可,在安装过程中会有要求用 ...
- liunx安装py.27
liunx安装py.27 按网站(https://blog.csdn.net/u012071918/article/details/78817344) 上的教程安装py.27 1.安装依赖的库 在终端 ...
- Liunx 安装 Nessus
Liunx 安装 Nessus 啥子是Nessus 它是一款系统漏洞扫描与分析软件,可以扫描服务器存在哪些漏洞,页面简介美观,非常Nice. 获取激活码 首先访问如下网站 https://www. ...
- window安装rsync客户端和服务端
原文地址: https://www.cnblogs.com/janas/p/3321087.html 下载地址: https://linux.linuxidc.com/index.php?folder ...
- Linux 安装Rsync和配置
1.检查rsync 是否已经安装 [root@test home]# rpm -qa|grep rsync 若已经安装,则使用rpm -e 命令卸载. [root@test home]#rpm -e ...
- linux 下安装rsync
一.服务器端配置: 1.安装xinetd,并修改rsync相关配置 # yum -y install xinetd # vi /etc/xinetd.d/rsync 如下代码: service rsy ...
- liunx 安装 mysql 5.6
第一步 解压文件 目录切换到/usr/local/ cd /usr/local/ 解压 tar zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz 重命名为 ...
- liunx 安装redis 4.0
liunx 上安装redis 4.0.1 第一步:将 redis-4.0.1.tar.gz 压缩问上传至/home目录下 第二步: 解压文件 tar -zxvf redis-4.0.1.tar.g ...
- 配置rsync 同步数据 rpm包安装rsync及配置
[root@Hammer home]# rpm -qa |grep rsync #检查系统是否安装了rsync软件包rsync-2.6.8-3.1[root@Hammer CentOS]# rpm - ...
随机推荐
- 支持快应用的http网络库-flyio
Fly.js 一个基于Promise的.强大的.支持多种JavaScript运行时的http请求库. 有了它,您可以使用一份http请求代码在浏览器.微信小程序.Weex.Node.React Nat ...
- 线程系列5--java中的ThreadLocal类实现线程范围内的数据共享(二)
ThreadLocal类可以理解成一个类似与map集合使用,以当前线程当做key 来使用,将线程氛围内需要共享的数据当做value,形成键值对的形式使用.ThreadLocal和线程同步机制都是为了解 ...
- python3笔记二十:时间操作time
一:学习内容 time时间戳 time元组 time字符串 time时间转换图解 二:time 需要引入:import time 1.概念 UTC(世界协调时间):格林尼治天文时间,世界标准时间,在中 ...
- 浅析SPDY
1.什么是SPDY? 简单地说,在SSL层上增加一个SPDY会话层,以在一个TCP连接支持并发的HTTP请求.也就是他能通过复用仅仅一条(或几条)TCP连接,在客户端与服务器间发送几十个请求或回应. ...
- Python定时框架 Apscheduler 详解【转】
内容来自网络: https://www.cnblogs.com/luxiaojun/p/6567132.html 在平常的工作中几乎有一半的功能模块都需要定时任务来推动,例如项目中有一个定时统计程序, ...
- Java-synchronized 中锁的状态及其转换
synchronized 锁的优化过程:无锁 -> 偏向锁 -> 轻量级锁 -> 重量级锁 一.不同锁对象的状态表示(需要了解 Java 对象头) https://wiki.open ...
- koa 基础(二十一)nodejs 操作mongodb数据库 --- 查询数据
1.app.js /** * nodejs 操作mongodb数据库 * 1.安装 操作mongodb * cnpm install mongodb --save * 2.引入 mongodb 下面的 ...
- php的core问题
我们在编写代码的时候,可能会发现,路径下多了一个类似这样的文件, 拿php举例 : core.php_bin.4528.1379650721 这是因为我们在编写代码时候,出现了指针溢出,段错误等问 ...
- selenium_java
等待 页面全加载 ChromeOptions options=new ChromeOptions(); /** *(1) NONE: 当html下载完成之后,不等待解析完成,selenium会直接返回 ...
- pycloudtag_wordcloud 中英文标签云
https://study.163.com/course/courseMain.htm?courseId=1006383008&share=2&shareId=400000000398 ...