1

inotify config:

/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

============================================================================

files that updated with rsync from remote server have this format:

/var/www/.index.php.3AYEV4 Wed-Sep-24-05:35:03

other files updated locally, they are good.

/var/www/index.php Wed-Sep-24-05:35:03

why is that?

ADM
  • 1,373
  • 12
  • 16

1 Answers1

3

The format is the same, it is the file names that are different.

It is because the way rsync works by default - it first creates temporary files (like .index.php.3AYEV4) and when they are finished syncing, only then they get renamed to final filenames (like index.php). You can either modify your inotifywait to have -e modify,move or change upsteam rsync to not use temporary files by using rsync --inplace flag (but see notes on --inplace)

Matija Nalis
  • 2,478
  • 24
  • 37