0

Here's my attempt:

start on (filesystem and net-device-up IFACE!=lo and file EVENT=modify FILE="/tmp/bar.txt")

task

script
  chdir /tmp
  exec echo THIS_CHANGED >> CHANGEDDDDDDDD
end script

But it only runs once. How do I make it run whenever /tmp/bar.txt is modified?

A T
  • 13,008
  • 21
  • 97
  • 158

1 Answers1

0

Pretty crappy solution, but this is all I've been able to get working:

start on (filesystem and net-device-up IFACE!=lo)

script
  chdir /tmp
  while inotifywait -e modify "/tmp/bar.txt"; do
    echo THIS_CHANGED >> CHANGEDDDDDDDD
  done
end script

Would much prefer not to add my own inotify watchers; and instead use the system level one.

A T
  • 13,008
  • 21
  • 97
  • 158