`
rensanning
  • 浏览: 3553470 次
  • 性别: Icon_minigender_1
  • 来自: 大连
博客专栏
Efef1dba-f7dd-3931-8a61-8e1c76c3e39f
使用Titanium Mo...
浏览量:38247
Bbab2146-6e1d-3c50-acd6-c8bae29e307d
Cordova 3.x入门...
浏览量:607654
C08766e7-8a33-3f9b-9155-654af05c3484
常用Java开源Libra...
浏览量:682870
77063fb3-0ee7-3bfa-9c72-2a0234ebf83e
搭建 CentOS 6 服...
浏览量:89578
E40e5e76-1f3b-398e-b6a6-dc9cfbb38156
Spring Boot 入...
浏览量:402165
Abe39461-b089-344f-99fa-cdfbddea0e18
基于Spring Secu...
浏览量:69772
66a41a70-fdf0-3dc9-aa31-19b7e8b24672
MQTT入门
浏览量:91866
社区版块
存档分类
最新评论

搭建 CentOS 6 服务器(11) - rsync、Amanda

 
阅读更多
(一)rsync

Server端
# yum install rsync
# vi /etc/xinetd.d/rsync
    service rsync
    {
        disable = no
        flags           = IPv6
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
    }
# vi /etc/rsyncd.conf
    #--------------
    # Global options
    #--------------
    uid           = root
    gid           = root
    log file      = /var/log/rsyncd.log
    pid file      = /var/run/rsyncd.pid
    hosts allow   = 192.168.21.0/24
    hosts deny    = *
    dont compress = *.gz *.tgz *.zip *.pdf *.sit *.sitx *.lzh *.bz2 *.jpg *.gif *.png

    #--------------
    # Module options
    #--------------
    [tmp]
        comment      = rsync server
        path         = /tmp/rsync_folder
        use chroot    = true
        auth users   = rsync_user1, rsync_user2
        secrets file = /etc/rsyncd.secrets
        read only    = false
        exclude      = *.mp
        include      = *.mp30
# mkdir -p /tmp/rsync_folder
# vi /tmp/rsync_folder/a.txt
    test
# vi /etc/rsyncd.secrets
    rsync_user1:password
    rsync_user2:password
# chmod 600 /etc/rsyncd.secrets
# service xinetd restart


Client端
# yum install rsync 
# vi /etc/rsync.passwd 
    password
# chmod 600 /etc/rsync.passwd


确认
# /usr/bin/rsync -avz --delete --password-file=/etc/rsync.passwd rsync://rsync_user1@192.168.21.140/tmp /usr/local/rsynctest
    receiving incremental file list
    ./
    a.txt

    sent 82 bytes  received 156 bytes  476.00 bytes/sec
    total size is 5  speedup is 0.02
# ls -l /usr/local/rsynctest


定期同步
# crontab -e
    #每5分钟同步
    */5 * * * * /usr/bin/rsync -avz --delete --password-file=/etc/rsync.passwd rsync://rsync_user1@192.168.21.140/tmp /usr/local/rsynctest


(二)Amanda

安装
# yum list | grep "^amanda"
  2.6.1p2-9.el6_6 版本比较旧
# yum install amanda


安装3.3.7
# cd /usr/local/src
# wget http://www.zmanda.com/downloads/community/Amanda/3.3.7/Source/amanda-3.3.7-1.rhel6.src.rpm
# rpm -Uvh amanda-3.3.7-1.rhel6.src.rpm


Server端
# vi /etc/hosts
    # amanda server端设置
    192.168.21.91 amcnt
# vi /var/lib/amanda/.amandahosts
    # amanda server端设置
    amcnt root amindexd amidxtaped #restore用
    amcnt amandabackup amdump #backup用
# mkdir -R /etc/amanda/demo
# cd /etc/amanda/demo
# cp /var/lib/amanda/example/amanda.conf .
# vi disklist
    amsrv /usr/data comp-user-tar
# vi /etc/xinetd.d/amanda
   disable = no
# /etc/init.d/xinetd restart


Client端
# vi /etc/hosts
    # amanda client端设置
    192.168.21.90 amsrv
# vi /var/lib/amanda/.amandahosts
   # amanda client端设置
   amsrv amandabackup amdump
# mkdir -R /etc/amanda/demo
# cd /etc/amanda/demo
# vi amanda-client.conf
    conf "demo"          # server端设置的名称
    index_server "amsrv"
    tape_server "amsrv"
    tapedev "file:/var/lib/amanda/vtl"
    auth "bsdtcp"
    ssh_keys ""  
    unreserved-tcp-port 1025,65535
# vi /etc/xinetd.d/amanda
    disable = no
# /etc/init.d/xinetd restart


定期同步
# crontab -e
    45 0 * * 2-6 /usr/sbin/amdump demo
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics