Essentially what you want to do is quite similar to basic intrusion monitoring. While you could easily configure tripwire to do this that would be total overkill. What you probably want is a basic IDS like Fcheck which is in perl so you can hack the good bits out.

If you are just monitoring a single dir you could just have a quick script that runs under cron. Make it silent for no changes and run it under your cron tab and it will email you with every change.

[root@devel3 root]# cat test.pl #!/usr/bin/perl my $dat = '/tmp/dat'; my $dir = '/root/'; if ( -e $dat ) { `ls -al $dir > $dat.current`; if ( `cat $dat` eq `cat $dat.current` ) { print "Dir $dir probably unchanged!\n"; } else { print "Dir $dir has changed\n", `diff -b $dat $dat.current`; `cat $dat.current > $dat`; } } else { `ls -al $dir > $dat`; # first pass init } [root@devel3 root]# ./test.pl # init stage [root@devel3 root]# ./test.pl Dir /root/ probably unchanged! [root@devel3 root]# touch foo [root@devel3 root]# ./test.pl Dir /root/ has changed 22a22 > -rw-r--r-- 1 root root 0 Feb 17 20:57 foo [root@devel3 root]# touch test.pl [root@devel3 root]# ./test.pl Dir /root/ has changed 56c56 < -rwxr-xr-x 1 root root 385 Feb 17 20:57 test.pl --- > -rwxr-xr-x 1 root root 385 Feb 17 20:58 test.pl [root@devel3 root]#

If you just wanted a list of filenames that has changed then just use ls. With ls -al it will pick changes to perms, ownership and M time of existing files as well as deletions/additions.

cheers

tachyon


In reply to Re: win32::ChangeNotify replacement for Unix? by tachyon
in thread win32::ChangeNotify replacement for Unix? by bjconnolly90

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.