歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> inotify實時同步腳本

inotify實時同步腳本

日期:2017/3/1 16:26:23   编辑:關於Linux
inotify實時同步腳本 inotify.sh #!/bin/bash src=/data/www/ /usr/local/bin/inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f%e' -e modify,delete,create,attrib $src | while read file do /usr/bin/rsync -arzuq --delete --progress $src 192.168.136.128::www/ echo " ${file} was rsynced" >>/tmp/rsync.log 2>&1 done chmod +x inotify.sh ./inotify.sh& //後台運行
Copyright © Linux教程網 All Rights Reserved