I would like to monitor my /etc folder (ubuntu 12.04 lts) for changes with incrond and I would like send the result in e-mail with the following command:
/etc IN_ATTRIB,IN_CREATE,IN_DELETE,IN_MODIFY,IN_MOVED_FROM,IN_MOVED_TO /usr/bin/mail -s "ALERT:in etc: $@/$#" [email protected] < /dev/null
But the e-mail doesnt come...
What is the matter?
Thanks for yor help.
I had similar troubles when I first tried using incron. The trick is that when the documentation says use command "abc $@/$#" it means exactly that. You will need to create a small shell script that takes the returned value from incrond and sends the appropriate mail message.
So the incrontab entry should look like this:
/etc IN_ATTRIB,IN_CREATE,IN_DELETE,IN_MODIFY,IN_MOVED_FROM,IN_MOVED_TO /usr/local/bin/mail_command.sh $@/$#
with mail_command.sh taking the given argument and processing as appropriate.
Matthew
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With