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

[b](一)rsync[/b]

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


[b](二)Amanda[/b]

安装
# 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值