当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > Linux:rsync服务器的快速搭建和使用

Linux服务器
在虚拟机RedhatLinux下安装Samba服务器
Linux系统下服务器硬件检查和文件传输
LinuxFtp服务器搭建支持Anonymous读写
Linux操作系统下Vsftp配置使用详细解析
Linux服务器的常用备份方法
SUSELinuxsubversion服务器自启动
RHEL下DHCP服务的配置与应用
linux自带的MAIL客户端用法
用NFS服务开发ARMLinux程序的方法
新手学堂:在Linux系统下mail命令的测试
UbuntuLinux系统下ApacheSSL配置方法
为Solaris服务器配置开源安全工具(下)
在Linux系统环境下配置WU-FTP服务器
Redhatlinux自动FTP传送备份
UbuntuLinux6.06LTS下安装Samba服务
在Centos5安装配置VNC的方法详细介绍
FedoraLinux8配置SAMBA服务的过程
Linux下成功安装和配置Sock5代理过程
实用技巧:Linux系统服务器快速登录
UbuntuServer系统用户安全优化方法

Linux服务器 中的 Linux:rsync服务器的快速搭建和使用


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 87 ::
收藏到网摘: n/a

  rsync是类unix系统下的数据镜像备份工具,从软件的命名上就可以看出来了--remote sync。它的特性如下:

  可以镜像保存整个目录树和文件系统。

  可以很容易做到保持原来文件的权限、时间、软硬链接等等。

  无须特殊权限即可安装。

  优化的流程,文件传输效率高。

  可以使用rcp、ssh等方式来传输文件,当然也可以通过直接的socket连接。

  支持匿名传输,以方便进行网站镜象。

  step

  1.从原始网站下载http://rsync.samba.org/ftp/rsync/

  2.[root@localhost bin]#./configure

  [root@localhost bin]#make

  [root@localhost bin]#make install

  说明一点,客户机和服务器都要安装rsync。客户机以客户端方式运行rsync,服务器端以服务器方式运行rsync,它监听873端口。

  3.运行rsync

  /usr/local/bin/rsync --daemon

  验证启动是否成功:

  netstat -na|grep 873

  4.配置rsync

  简单配置:编辑/etc/rsyncd.conf文件如下:

  #全局配置部分

  secrets file = /etc/rsyncd.secrets 认证用户名和密码文件的名称和位置

  motd file = /etc/rsyncd.motd 欢迎信息文件名称和存放位置(此文件没有,可以自行添加)

  read only = yes

  list = yes

  uid = root

  gid = root

  #hosts allow = 10.4.5.213

  #hosts deny = 10.4.5.0/24

  use chroot = no

  max connections = 5

  log file = /var/log/rsyncd.log

  pid file = /var/run/rsyncd.pid

  lock file = /var/run/rsync.lock

  #模块配置部分

  [paolo]

  comment = Paolo 's directory

  path = /home/test/software

  auth users = rsync

  #secrets file = /etc/rsyncd.secrets

  5.生成验证证文件

  echo "rsync:rsync_password" >> /etc/rsyncd.secrets

  chmod 600 /etc/rsyncd.secrets

  6.在客户端服务器同步服务器上的文件

  rsync -vzrtopg --delete --progress [email protected]::paolo /china/

  或加上--password-file=/etc/rsyncd.secrets选项

  上面的命令把10.4.5.161服务器上的paolo模块中的目录的文件传送到本机/china目录中,并删除本机/china目录中在161服务器paolo模块指定目录中没有的文件。以使两台计算机的目录文件同步。
 
  请作者联系本站,及时附注您的姓名。联系邮箱:edu#ruanchen.com(把#改为@)。