rsync to backup

This is a good tutorial

Below is a sample rsync configuration file. It is placed in your /etc directory as rsyncd.conf.

[simple_path_name]
path = /rsync_files_here
comment = My Very Own Rsync Server
uid = nobody
gid = nobody
read only = no
list = yes
auth users = username
secrets file = /etc/rsyncd.scrt

[ccxxxx-backup]
path = /home/ccxxxx-backup
hosts allow = xxx.xxx.xxx.xxx
hosts deny = *
list = true
uid = root
gid = root
read only = false

reset iptables
Flush All Rules, Delete All Chains, and Accept All
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT

sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -F
sudo iptables -X

Block the most common attacks
blocking null packets.
iptables -A INPUT -p tcp ! –syn -m state –state NEW -j DROP
reject is a syn-flood attack.
iptables -A INPUT -p tcp –tcp-flags ALL ALL -j DROP
Enable local interfaces
iptables -A INPUT -i lo -j ACCEPT
allow web server traffic
iptables -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 443 -j ACCEPT
allow SSH traffic
iptables -A INPUT -p tcp -m tcp –dport 22 -j ACCEPT
allow all outgoing connections
iptables -I INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
allow rsync
iptables -I INPUT -p tcp –dport 873 -s xxx.xxx.xxx.xxx -j ACCEPT

save our firewall configuration
iptables-save | sudo tee /etc/sysconfig/iptables
service iptables restart

at the other machine run
rsync -avz –delete –exclude-from=/etc/rsync_exclude.lst / 198.23.241.151::cctan-backup

Launching rsync with the –daemon attribute
sudo rsync –daemon

rsync 常见的问题

发表评论

电子邮件地址不会被公开。 必填项已用*标注