zoukankan      html  css  js  c++  java
  • [rsync]linux rsync 搭建

    linux rsync 搭建

    作者:flymaster

    qq:908601287

    blog:http://www.cnblogs.com/flymaster500/

    rsync server:配置步骤
    1.vi /etc/rsyncd.conf
    #Rsync server
    #created by oldboy
    ##rsyncd.conf start##
    uid = rsync
    gid = rsync
    use chroot =no
    max connections =2000
    timeout =600
    pid file = /var/run/rsyncd.pid
    lock file = /var/run/rsync.lock
    log file = /var/log/rsyncd.log
    ignore errors
    read only = false
    list = false
    hosts allow = 192.168.70.0/24
    hosts deny = 0.0.0.0/32
    auth users = rsunc_backup
    secrets file = /etc/rsync.password
    ########################################
    [backup]
    comment = www by old0boy
    path = /backup
    ############################################


    2.创建rsync用户、共享目录/backup
    useradd rsync -s /sbin/nologin -M
    id rsync

    mkdir /backup
    chown -R rsync /backup
    ll-d /backup/

    3.创建密码文件
    echo "rsync_backup:oldboy" >/etc/rsync.password
    chmod 600 /etc/rsync.password

    4.rsync --daemon
    netstat -lntup|grep rsync
    ps -ef|grep rsync|grep -v grep

    5.加入开机自启动
    echo "rsync --daemon" >>/etc/rc.local
    cat /etc/rc.local
    rsync:客服端
    1.创建密码文件
    echo "oldboy" >/etc/rsync.password
    chmod 600 /etc/rsync.password
    ls -l /etc/rsync.password
    2.rsync
    tar Pczf backup_`ifconfig eth0|awk -F "[ :]+" 'NR==2{print $4}'`_$(date +%F).tar.gz /var/spool/cron/ /etc/rc.local /etc/sysconfig/iptables
    rsync -avz /backup/ rsync_backup@192.168.1.6::backup --password-file=/etc/rsync.password
    push:
    rsync[OPTION...] SRC...[USER@]HOST::DEST

    作者:flymaster

    qq:908601287

    blog:http://www.cnblogs.com/flymaster500/

  • 相关阅读:
    C++ STL 一般总结(转载)
    Python高级语法总结
    Adaboost 算法的原理与推导——转载及修改完善
    简化版SMO算法标注
    【转载】机器学习算法基础概念学习总结
    C++中添加配置文件读写方法
    Python中scatter()函数--转载
    python 之 strip()--(转载)
    zabbix邮件报警脚本(Python)
    Linux常用命令
  • 原文地址:https://www.cnblogs.com/flymaster500/p/10155515.html
Copyright © 2011-2022 走看看