inotify实现目录同步

vim a.sh

#!/bin/bash

file1=/tmp/a/

inotifywait -mrq --timefmt '%d/%m/%y-%H:%M' --format '%T %w%f' -e modify,delete,create,attrib ${file1} | while read file

do 

rsync -az --delete ${file1} *.*.*.*:${file1}

done


sh a.sh &

你可能感兴趣的:(linux,inotify,目录同步)