How to act every time a file is (re)-created with some words

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have a file /usr/local/var/log/locate/upd_locatedbs_core.log which is created every night. Normally it does not contain the string "Excluding ALL external volumes". When it does, I want to show a notification (via a shell script).

I created the following rule watching the folder /usr/local/var/log/locate/:

Image

This works -- but only once: When I delete the file and recreate it (either by writing to it or by copying it), nothing happens again. However that's exactly what I want to test for: Whether the file was (re)created with a certain content....

Any idea how I can fix this? Many thanks in advance!
halloleo
 
Posts: 45
Joined: Thu Apr 27, 2017 10:10 pm

Try adding a condition like "Date last modified is after date last matched"
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Try adding a condition like "Date last modified is after date last matched"


Cool! Thanks.
halloleo
 
Posts: 45
Joined: Thu Apr 27, 2017 10:10 pm


Return to Support