0

I am running code that allows you to execute a command if flow.xml.gz changes:

 while inotifywait -e modify,move,create,delete flow.xml.gz; do echo "test"; done

When I change the file nothing happens. I have only this output:

smadmin@sm-iotdf-mini-dev:~/nifi-1.4.0/conf$ while inotifywait -e modify,move,create,delete flow.xml.gz; do echo "test"; done
Setting up watches.
Watches established.
John Kugelman
  • 349,597
  • 67
  • 533
  • 578
amira khalifa
  • 107
  • 3
  • 11

1 Answers1

0

Run inotifywait -m flow.xml.gz . to monitor all events from both the file and its parent directory and see what's happening. You're only watching for 4 of the 15 types of events.

  • create and delete don't do what you think. To monitor for file creation/deletion you need to watch the parent directory, not the file itself.
  • Watch for move_self and delete_self if you're monitoring the file directly. Note that there's no create_self.
John Kugelman
  • 349,597
  • 67
  • 533
  • 578