centos rsync安装配置
安装
1
|
yum -y install rsync |
---------------------服务器安装-------------------------------
创建基础配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#vim /etc/rsyncd.conf uid = root gid = root use chroot = no max connections = 5 pid file = / var /run/rsyncd.pid lock file = / var /run/rsync.lock log file = / var /log/rsyncd.log [www] path = /usr/local/nginx/html/down/ ignore errors read only = true list = false auth users = rsync secrets file = /etc/rsync.pas |
创建密码配置文件
1
2
|
#vi /etc/rsync.pas rsync:yourpassword |
将rsync.pas设置为root所有, 权限为600
1
2
|
chown root.root /etc/rsync.pas chmod 600 /etc/rsync.pas |
启动:
1
|
/usr/bin/rsync --daemon |
打开防火墙设置873端口:编辑/etc/sysconfig/iptables文件,添加873端口
关闭selinux:打开/etc/selinux/config文件,修改SELINUX=disabled
------------------------------客户端安装-----------------------------------------
创建基础配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#vim /etc/rsyncd.conf uid = root gid = root use chroot = no max connections = 5 pid file = / var /run/rsyncd.pid lock file = / var /run/rsync.lock log file = / var /log/rsyncd.log [www] path = /usr/local/test/ ignore errors read only = true list = false auth users = rsync secrets file = /etc/rsync.pas |
创建密码配置文件
1
2
|
#vi /etc/rsync.pas yourpassword |
将rsync.pas设置为root所有, 权限为600
1
2
|
chown root.root /etc/rsync.pas chmod 600 /etc/rsync.pas |
执行同步命令:
1
|
rsync -vrtup -R -- delete rsync@ 10.10 . 10.10 ::www --password-file=/etc/rsync.pas /usr/local/test/ |
命令解析:
1
2
3
4
5
6
7
8
9
10
11
12
|
-v, --verbose 详细模式输出 -r, --recursive 对子目录以递归模式处理 -t, --times 保持文件时间信息 -u, --update 仅仅进行更新,也就是跳过所有已经存在于DST,并且文件时间晚于要备份的文件。(不覆盖更新的文件) -p, --perms 保持文件权限 rsync@ 10.10 . 10.10 ::www rsync - 登陆用户名 10.10 . 10.10 - 服务器IP www - 主配置文件中的段名 --password-file=/etc/rsync.pas - 指定密码文件 /usr/local/test/ - 要同步到的本地目标文件夹 |
设置自动运行脚本,每5秒执行一次同步
1
2
3
4
5
6
7
|
#!/bin/bash while [ 1 ] do rsync -vrtup -R rsync@ 10.10 . 10.10 ::www -- delete --password-file=/etc/rsync.pas /usr/local/nginx/html/down sleep 5 done |
设置脚本自启动:
在centos5 和 centos6中,方法不太一样。centos6可以参见另一篇文章:
http://hi.baidu.com/solohac/item/9a89bf4257a97eeaa5c066cd
centos rsync安装配置的更多相关文章
- Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)
Centos下安装配置LAMP(Linux+Apache+MySQL+PHP) 关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...
- CentOS 7安装配置Apache HTTP Server
原文 CentOS 7安装配置Apache HTTP Server RPM安装httpd # yum -yinstall httpd //安装httpd会自动安装一下依赖包: apr apr-ut ...
- CentOS 7 安装配置 NFS
CentOS 7 安装配置 NFS 环境 nps 192.168.1.97 client 192.168.1.98 一.yum 安装 yum -y install nfs-utils rpcbind ...
- 分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)——第一篇
分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)--第一篇 简介 首先简单了解一下基础概念,FastDFS是一个开源的轻量级分布式文件系统,由 ...
- CentOS 7安装配置Samba服务器
CentOS 7安装配置Samba服务器 CentOS 7下Samba服务器安装配置过程笔记. 假设我们有这样一个场景 共享名 路径 权限 SHAREDOC /smb/docs 所有人员包括来宾均可以 ...
- CentOS 7安装配置Samba服务器(挂载共享文件夹)
CentOS 7安装配置Samba服务器 CentOS 7下Samba服务器安装配置过程笔记. 假设我们有这样一个场景 共享名 路径 权限 SHAREDOC /smb/docs 所有人员包括来宾均可以 ...
- 记录:CentOS 7 安装配置分布式文件系统 FastDFS 5.1.1
CentOS 7 安装配置分布式文件系统 FastDFS 5.1.1 软件下载:http://download.csdn.net/download/qingchunwuxian1993/9897458 ...
- CentOS gitlab 安装配置
CentOS gitlab 安装配置 2018-11-02 11:23:09 Visit 5 在/etc/yum.repos.d 目录下创建文件gitlab-ce.repo,使用国内的安装源 b ...
- <转>CentOS 7 安装配置 NFS
CentOS 7 安装配置 NFS 环境 nps 192.168.1.97 client 192.168.1.98 一.yum 安装 yum -y install nfs-utils rpcbind ...
随机推荐
- ASPxGridView中批量提交及个别提交的写法
//获取chech box ID protected string GetProtoID() { string protoId = ""; //获取选中的记录Id List< ...
- javascript代码复用模式(三)
前面谈到了javascript的类式继承.这篇继续部分类式继承,及一些现代继承. 类式继承模式-代理构造函数 这种模式通过断开父对象与子对象之间原型之间的直接链接关系,来解决上次说到的共享一个原型所带 ...
- 一个不简单的Procedure body例子
create or replace package body CountBankData_20150617 is type cursorCommon is ref cursor; --游标类型 str ...
- phongap+ jquery + asp.net +android,我把我遇到的问题和处理方法的连接总结一下
这些都是最基本的问题,在实际的运用中都会用到 第1章.搭建Android的开发环境-跟我学编程 Win7旗舰版中的IIS配置asp.net的运行环境 - 追夢 - 博客园 vs2012下asp.net ...
- play framework 框架安装及myeclipse 导入项目
下载 play framework 框架. 解压你你要解压的目录 E:\play-1.2.7 相对其他的WEB框架.play的配置是相当简单的.没有那么多配置文件的搞法.上手比较快,就是相关的资料比较 ...
- 【转载】FPGA功耗的那些事儿
在项目设计初期,基于硬件电源模块的设计考虑,对FPGA设计中的功耗估计是必不可少的. 笔者经历过一个项目,整个系统的功耗达到了100w,而单片FPGA的功耗估计得到为20w左右, 有点过高了,功耗过高 ...
- SQLserver2008使用表达式递归查询(由父往子,由子往父)
SQLserver2008使用表达式递归查询语句 --由父项递归下级 with cte(id,parentid,text) as (--父项 select id,parentid,text from ...
- 为何要使用Linux
摈弃 Windows 低效率的工作方式,发掘 Linux 身上的 UNIX 气质 我已经半年没有使用 Windows 的方式工作了.Linux 高效的完成了我所有的工作. GNU/Linux 不是每个 ...
- javaSE第七天
第七天 36 1. 成员变量和局部变量的区别(理解) 36 (1)在类中的位置不同 36 (2)在内存中的位置不同 36 (3)生命周期不同 36 (4)初始化值不同 ...
- 捣蛋phpwind之WindFrameWork
一直都有关注phpwind这个开源产品,从9.0开始就好关注拉,因为官方说把之前的代码重写了一遍,融入了windFramework这个框架,代码真的挺优美的,今日在做社区的一些功能,心血来潮就参考了p ...