腳本備份-rsync +inotify

/usr/bin/inotifywatchsvn

/usr/bin/inotifywaitip


#!/bin/shit

SRC=/opt/smc/xuanlifile

DST=smc@*****:/opt/smc/xuanlirsync

/usr/bin/inotifywait -mrq -e modify,delete,create,attrib ${SRC} | while read D E Fdi

   dowhile

     /usr/bin/rsync -ahqzt --delete $SRC $DSTco

   donewatch


  1 #!/bin/shsync

  2 SRC=/opt/smc/***

  3 DST=***@***:/opt/smc/***/aa01

  4 conf=/opt/smc/****

  5 RSYNC_EXCLUDE="--include-from=$conf/rsync_include.list --exclude-from=$conf/rsync_exclude.list"

  6 INOTIFY_EXCLUDE="--fromfile $conf/inotify_exclude.list"

  7 /usr/bin/inotifywait -mrq  --exclude "(.data|.seq|.swp|.inc|.svn|.rar|.tar.gz|.gz|.txt|.zip|.bak|.log)"  -e modify,delete,cr

    eate,attrib ${SRC}  $INOTIFY_EXCLUDE | while read D E F

  8    do

  9      /usr/bin/rsync -r -ahqzt $RSYNC_EXCLUDE --delete $SRC $DST

 10    done

相關文章
相關標籤/搜索