搭建 CentOS 6 伺服器(13) - rsync、Amanda

來源:互聯網
上載者:User

標籤:

(一)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://[email protected]/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://[email protected]/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 

搭建 CentOS 6 伺服器(13) - rsync、Amanda

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.