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?

share|improve this question

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.