rsync

A配置

uid = 0

gid = 0

use chroot = no

max connections = 5

timeout = 300

strict modes = no

auth users = bak

secrets file = /etc/rsyncd.passwd

pid file = /var/run/rsyncd.pid

lock file = /var/run/rsync.lock

log file = /var/log/rsyncd.log

hosts allow = 10.140.6.20/255.255.255.255

hosts deny = *

[db]

comment = This is DA db2 backup

path=/home/db2admin/backup

ignore errors

read only = yes

[log]

comment = This is DB2 archlog file

path=/home/db2admin/archlog/

ignore errors

read only = yes

Rysncd.passwd

bak:bak5122

#/usr/bin/rsync --port=8833 --daemon �Cconfig=/etc/rsyncd.conf

B配置

/etc/cron.daily/bk5122

#!/bin/bash

#DD=`date +%d`

#if [ ! -d /ipsan_data/backup/bk5122/db_md/$DD ]; then

#   mkdir -p /ipsan_data/backup/bk5122/db_md/$DD

#fi

#if [ ! -d /ipsan_data/backup/bk5122/archlog_md/$DD ]; then

#   mkdir -p /ipsan_data/backup/bk5122/archlog_md/$DD

#fi

/usr/bin/rsync -azv --delete  --port=8833 --password-file=/etc/rsyncd.passwd [email protected]::db /ipsan_data/backup/bk5122/db >> /var/log/bk5122.log && echo "db_`date +%y%m%d` is complete!" >> /var/log/bk5122.log

sleep 3

/usr/bin/rsync -azv --delete  --port=8833 --password-file=/etc/rsyncd.passwd [email protected]::log /ipsan_data/backup/bk5122/archlog >> /var/log/bk5122.log && echo "archlog_`date +%y%m%d` is complete!" >> /var/log/bk5122.log




你可能感兴趣的:(rsync)