backup作为实时共享使用
常规:crond+rsync
打开backup服务器:
[root@backup ~]# ps -ef|grep rsync
root 1296 1 0 21:51 ? 00:00:00 /usr/bin/rsync --daemon
root 1505 1489 0 23:54 pts/0 00:00:00 grep rsync
[root@backup ~]# lsof -i tcp:873
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 1296 root 4u IPv4 10869 0t0 TCP *:rsync (LISTEN)
rsync 1296 root 5u IPv6 10870 0t0 TCP *:rsync (LISTEN)
vi /etc/rsyncd.conf增加一个模块
[nfsbackup]
path=/nfsbackup
[root@backup ~]# vi /etc/rsyncd.conf
[root@backup ~]# pkill rsync
[root@backup ~]# lsof -i tcp:873
[root@backup ~]# rsync --daemon
[root@backup ~]# lsof -i tcp:873
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 1529 root 4u IPv4 12693 0t0 TCP *:rsync (LISTEN)
rsync 1529 root 5u IPv6 12694 0t0 TCP *:rsync (LISTEN)
[root@backup ~]# mkdir -p /nfsbackup
[root@backup ~]# chown -R rsync.rsync /nfsbackup
下面是在nfs服务器上面操作:
[root@oldboy ~]# rsync -avz /data/ rsync_backup@172.16.1.41::nfsbackup --password-file=/etc/rsync.password
sending incremental file list
./
a.txt
b.txt
sent 156 bytes received 49 bytes 410.00 bytes/sec
total size is 0 speedup is 0.00
第一个里程碑:
a实现从nfs客户端到rsync服务端的rsynbc服务器部署
inotify简介:
inotify是一种强大的,细粒度的,异步的文件系统事件监控机制。
409
转载于:https://blog.51cto.com/sandshell/1954325