I am trying to create a daemon to monitor a users's bash_history file for manual modifications. In other words, if a user opens the file and modifies it, the daemon will notify this action for safety measures, but when the history updates itself, nothing happens.
The solution I tried is using inotifywait:
while true; do inotifywait -e close_write,move,delete ~/.bash_history && notify done
where notify is a script that will do a specific notification procedure.
I believe this would work fine for most of files, but in this case it doesn't, since notify is executed every time the history updates.
Is it possible this way, or should I use another application?