zoukankan      html  css  js  c++  java
  • 搭建 CentOS 6 服务器(13)

    (一)rsync

    Server端

    Java代码  收藏代码
    1. # yum install rsync  
    2. # vi /etc/xinetd.d/rsync  
    3.     service rsync  
    4.     {  
    5.         disable = no  
    6.         flags           = IPv6  
    7.         socket_type     = stream  
    8.         wait            = no  
    9.         user            = root  
    10.         server          = /usr/bin/rsync  
    11.         server_args     = --daemon  
    12.         log_on_failure  += USERID  
    13.     }  
    14. # vi /etc/rsyncd.conf  
    15.     #--------------  
    16.     # Global options  
    17.     #--------------  
    18.     uid           = root  
    19.     gid           = root  
    20.     log file      = /var/log/rsyncd.log  
    21.     pid file      = /var/run/rsyncd.pid  
    22.     hosts allow   = 192.168.21.0/24  
    23.     hosts deny    = *  
    24.     dont compress = *.gz *.tgz *.zip *.pdf *.sit *.sitx *.lzh *.bz2 *.jpg *.gif *.png  
    25.   
    26.     #--------------  
    27.     # Module options  
    28.     #--------------  
    29.     [tmp]  
    30.         comment      = rsync server  
    31.         path         = /tmp/rsync_folder  
    32.         use chroot    = true  
    33.         auth users   = rsync_user1, rsync_user2  
    34.         secrets file = /etc/rsyncd.secrets  
    35.         read only    = false  
    36.         exclude      = *.mp  
    37.         include      = *.mp30  
    38. # mkdir -p /tmp/rsync_folder  
    39. # vi /tmp/rsync_folder/a.txt  
    40.     test  
    41. # vi /etc/rsyncd.secrets  
    42.     rsync_user1:password  
    43.     rsync_user2:password  
    44. # chmod 600 /etc/rsyncd.secrets  
    45. # service xinetd restart  



    Client端

    Java代码  收藏代码
    1. # yum install rsync   
    2. # vi /etc/rsync.passwd   
    3.     password  
    4. # chmod 600 /etc/rsync.passwd  



    确认

    Java代码  收藏代码
    1. # /usr/bin/rsync -avz --delete --password-file=/etc/rsync.passwd rsync://rsync_user1@192.168.21.140/tmp /usr/local/rsynctest  
    2.     receiving incremental file list  
    3.     ./  
    4.     a.txt  
    5.   
    6.     sent 82 bytes  received 156 bytes  476.00 bytes/sec  
    7.     total size is 5  speedup is 0.02  
    8. # ls -l /usr/local/rsynctest  



    定期同步

    Java代码  收藏代码
    1. # crontab -e  
    2.     #每5分钟同步  
    3.     */5 * * * * /usr/bin/rsync -avz --delete --password-file=/etc/rsync.passwd rsync://rsync_user1@192.168.21.140/tmp /usr/local/rsynctest  



    (二)Amanda

    安装

    Java代码  收藏代码
    1. # yum list | grep "^amanda"  
    2.   2.6.1p2-9.el6_6 版本比较旧  
    3. # yum install amanda  



    安装3.3.7

    Java代码  收藏代码
    1. # cd /usr/local/src  
    2. # wget http://www.zmanda.com/downloads/community/Amanda/3.3.7/Source/amanda-3.3.7-1.rhel6.src.rpm  
    3. # rpm -Uvh amanda-3.3.7-1.rhel6.src.rpm  



    Server端

    Java代码  收藏代码
    1. # vi /etc/hosts  
    2.     # amanda server端设置  
    3.     192.168.21.91 amcnt  
    4. # vi /var/lib/amanda/.amandahosts  
    5.     # amanda server端设置  
    6.     amcnt root amindexd amidxtaped #restore用  
    7.     amcnt amandabackup amdump #backup用  
    8. # mkdir -R /etc/amanda/demo  
    9. # cd /etc/amanda/demo  
    10. # cp /var/lib/amanda/example/amanda.conf .  
    11. # vi disklist  
    12.     amsrv /usr/data comp-user-tar  
    13. # vi /etc/xinetd.d/amanda  
    14.    disable = no  
    15. # /etc/init.d/xinetd restart  



    Client端

    Java代码  收藏代码
    1. # vi /etc/hosts  
    2.     # amanda client端设置  
    3.     192.168.21.90 amsrv  
    4. # vi /var/lib/amanda/.amandahosts  
    5.    # amanda client端设置  
    6.    amsrv amandabackup amdump  
    7. # mkdir -R /etc/amanda/demo  
    8. # cd /etc/amanda/demo  
    9. # vi amanda-client.conf  
    10.     conf "demo"          # server端设置的名称  
    11.     index_server "amsrv"  
    12.     tape_server "amsrv"  
    13.     tapedev "file:/var/lib/amanda/vtl"  
    14.     auth "bsdtcp"  
    15.     ssh_keys ""    
    16.     unreserved-tcp-port 1025,65535  
    17. # vi /etc/xinetd.d/amanda  
    18.     disable = no  
    19. # /etc/init.d/xinetd restart  



    定期同步

      1. # crontab -e  
      2.     45 0 * * 2-6 /usr/sbin/amdump demo 
  • 相关阅读:
    python之ConfigParser模块
    python之os模块
    python之cx_oracle模块
    python之zipfile模块
    python之sys模块
    python相关模块链接
    Server.UrlPathEncode和Server.UrlEncode的区别
    设置或者得到CheckBoxList选中了的值
    一些数据格式化-Eval( " ")和DataBinder.Eval(Container.DataItem, " ")的区别及用法
    ADO中数据库连接字符串的几种写法
  • 原文地址:https://www.cnblogs.com/kyli816/p/4627126.html
Copyright © 2011-2022 走看看