N
N
Nurlan2015-09-24 14:49:15
Debian
Nurlan, 2015-09-24 14:49:15

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

But there is nothing in the log. What could be the reason?
UPD: Solution
/etc/iwatch/iwatch.xml config code:
<?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

1 answer(s)
A
Anton B, 2015-09-24
@daager

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 question

Ask a Question

731 491 924 answers to any question