I need something that does not need to be installed. It's on an embedded system with very little space on the HD. I can't instal anything. I need to do it with something that is already included.
I have a script that I want to run based on a certain line that appears in a log file. Currenty I placed this script to run every 5 minutes in the crontab and check the file for changes.
Is there a way that I can have the system call the script only if the file has changed? Like, to tell the system to fire the script in case a system call was made to open that file with write permission?
fail2ban
does. – Stéphane Chazelas Feb 26 '14 at 15:41syslog
implementation (most systems will have one unless very rudimentary), maybe there is a way to do it with that. Otherwise ifinotify
is configured in the kernel, a short C program may do the job. – Graeme Feb 28 '14 at 00:38