Inotify


NFS上のすべてのデータをrsyncに保存します。 daemenサーバー、リアルタイムバックアップ:[root@NFS-server ~]# rpm -qa。 inotify[root@NFS-server ~]# wget http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz inotify-tools-3.14.tar.gz[root@NFS-server ~]# タラ -zxvf inotify-tools-3.14.tar.gz [root@NFS-server ~]# ls  anan conda-ks.cfg  index.httml.1        inotify-tools-3.14.tar.gz    install.log         wget-log  index.       inotify-tools-3.14  inotify-tools-3.14.tar.gz.1  install.log.syslog  [root@NFS-server ~]# cd inotify-tools-3.14[root@NFS-server inotify-tools-3. ./configure --prefix=/usr/local/inotify-tools-3.14  [root@NFS-server inotify-tools-3. メーク && メーク install[root@NFS-server inotify-tools-3. echo $?   0[root@NFS-server inotify-tools-3. cd  [root@NFS-server ~]# ln -s /usr/local/inotify-tools-38.14/ /usr/local/inotify-tools  [root@NFS-server ~]# ll /usr/local/inotify-tools  lrwxrxrwxrwx. 1 root root 30 Jul  6 19:53 /usr/local/inotify-tools -> /usr/local/inotify-tools-33.14/[root@NFS-server ~]# echo 「oldboy」 >/etc/rsync.password  [root@NFS-server ~]# chmod 600 /etc/rsync.password    [root@NFS-server ~]# ll /etc/rsync.password    -rw---. 1 root root 7 Jul  6 20:03 /etc/rsync.password  [root@NFS-server ~]# cat /etc/rsync.password    oldboy [root@NFS-server ~]# /usr/local/inotify-tools/bin/inotifywait -mrq --timefmt '%d/%m/%y%H:%M' --フォーマット '%T%w%f -e  create、delete /backup/     
[root@NFS-server ~]# vim /server/scripts/inotify.sh  
#!/bin/sg
 #print for Check the backup data integrity of /backup  by yvonne 2015-7-6 17:56:15.
 
 /usr/local/inotify-tools/bin/inotifywait -mrq --timefmt '%d/%m/%y%H:%M' --format '%T%w%f' -e create,delete /backup/ \
 |while read file
  do
  rsync -r /data [email protected]::backup --password-file=/etc/rsync.password
 done