美文网首页
CetOS使用rsync

CetOS使用rsync

作者: 袁先生的笔记 | 来源:发表于2020-08-25 19:41 被阅读0次

环境

系统:CentOS 7

rsync服务端

  • 安装

    # yum install rsync
    
  • 编辑主配置文件

    # vim /etc/rsyncd.conf
    uid = root
    gid = root
    use chroot = yes
    read only = no
    transfer logging = yes
    log file = /var/log/rsyncd.log
    secrets file = /etc/rsyncd.secrets
    
    [backup]
      path = /data/backup
    
  • 创建用户密码文件

    # vim /etc/rsyncd.secrets
    rsync_user:rsync_password
    
    # chmod 600 /etc/rsyncd.secrets
    
  • 创建模块目录

    # mkdir -p /data/backup
    

rsyn使用

  • 本地拷贝

    rsync [OPTION]... SRC DEST
    
  • 远程拷贝

    rsync [OPTION]... SRC [USER@]host:DEST
    rsync [OPTION]... [USER@]HOST:SRC DEST
    
  • 使用rsync服务远程拷贝

    rsync [OPTION]... [USER@]HOST::SRC DEST 
    rsync [OPTION]... SRC [USER@]HOST::DEST
    

相关文章

网友评论

      本文标题:CetOS使用rsync

      本文链接:https://www.haomeiwen.com/subject/shizjktx.html