Answer the question
In order to leave comments, you need to log in
How to make change logging through incron?
It is necessary to log changes in the /etc folder. Decided to use incron.
Installed, allowed for root, edited.
The config is like this:
/etc IN_MODIFY,IN_CREATE,IN_DELETE echo "[email protected] $% $#" >> /var/log/icl.log
<?xml version="1.0" ?>
<!DOCTYPE config SYSTEM "/etc/iwatch/iwatch.dtd" >
<config>
<guard email="[email protected]" name="IWatch"/>
<watchlist>
<title>etcspy</title>
<contactpoint email="[email protected]" name="Administrator"/>
<path type="recursive" events="modify,create,delete" exec="echo '%f %e' >> /var/log/icl.log">/etc</path>
</watchlist>
</config>
Answer the question
In order to leave comments, you need to log in
Have you written in /etc/incron.allow root?
And I recommend looking in the direction of iwatch , the possibilities are much wider. An example of my config:
<?xml version="1.0" ?>
<!DOCTYPE config SYSTEM "/etc/iwatch/iwatch.dtd" >
<config>
<guard email="[email protected]" name="root"></guard>
<watchlist>
<title>Only Test</title>
<contactpoint email="[email protected]" name="root"></contactpoint>
<path type="recursive" exec="/var/www/mysite/data/sh/file_change.sh %f %e" filter="\.(php|css|js)$">/var/www/mysite/data/www/mysite.ru</path>
</watchlist>
</config>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question