inotifyconfiguration:
/usr/bin/inotifywait -e modify \ -mrq --timefmt %a-%b-%d-%T --format '%w%f %T' \ /var/www/ | while read file; do echo "$file " >> /var/log/inotify.log
================================================== ==========================
使用远程服务器的rsync更新的文件具有以下格式:
/var/www/.index.php.3AYEV4 Wed-Sep-24-05:35:03
其他文件在本地更新,他们是好的。
/var/www/index.php Wed-Sep-24-05:35:03
这是为什么?
格式是一样的,它是不同的文件名。
这是因为rsync默认工作 – 它首先创build临时文件(如.index.php.3AYEV4 ),当它们完成同步时,只有它们被重命名为最终文件名(如index.php )。 你可以修改你的inotifywait让-e modify,move或者改变upsteam rsync来使用rsync --inplace标志不使用临时文件(但是可以在–inplace上看到注释 )