<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Recursive Inotify Daemon	</title>
	<atom:link href="https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Wed, 18 Mar 2015 14:36:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>
		By: BFallert		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-221994</link>

		<dc:creator><![CDATA[BFallert]]></dc:creator>
		<pubDate>Wed, 18 Mar 2015 14:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-221994</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-83640&quot;&gt;Cory Albrecht&lt;/a&gt;.

for IN_DELETE and IN_MOVED_FROM you can use following change.

if(-d $filename &#038;&#038; $e-&#062;IN_CREATE) {
    create_watcher($inotify, $filename);
    return
}
elsif($e-&#062;IN_DELETE) {
    print __LINE__ . &quot;: IN_DELETE $filename\n&quot;;
}
elsif($e-&#062;IN_MOVED_FROM){
    print &quot;IN_MOVE_FROM $filename\n&quot;
}
elsif(-f $filename){
    if($e-&#062;IN_CLOSE_WRITE){
        print &quot;IN_CLOSE_WRITE $filename\n&quot;
    }
    #elsif($e-&#062;IN_MOVED_FROM){
    #    print &quot;IN_MOVE_FROM $filename\n&quot;
    #}
    elsif($e-&#062;IN_MOVED_TO){
        print &quot;IN_MOVED_TO $filename\n&quot;
    }
    #elsif($e-&#062;IN_DELETE){
    #    print &quot;IN_DELETE $filename\n&quot;
    #}
}]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-83640">Cory Albrecht</a>.</p>
<p>for IN_DELETE and IN_MOVED_FROM you can use following change.</p>
<p>if(-d $filename &amp;&amp; $e-&gt;IN_CREATE) {<br />
    create_watcher($inotify, $filename);<br />
    return<br />
}<br />
elsif($e-&gt;IN_DELETE) {<br />
    print __LINE__ . &#8220;: IN_DELETE $filename\n&#8221;;<br />
}<br />
elsif($e-&gt;IN_MOVED_FROM){<br />
    print &#8220;IN_MOVE_FROM $filename\n&#8221;<br />
}<br />
elsif(-f $filename){<br />
    if($e-&gt;IN_CLOSE_WRITE){<br />
        print &#8220;IN_CLOSE_WRITE $filename\n&#8221;<br />
    }<br />
    #elsif($e-&gt;IN_MOVED_FROM){<br />
    #    print &#8220;IN_MOVE_FROM $filename\n&#8221;<br />
    #}<br />
    elsif($e-&gt;IN_MOVED_TO){<br />
        print &#8220;IN_MOVED_TO $filename\n&#8221;<br />
    }<br />
    #elsif($e-&gt;IN_DELETE){<br />
    #    print &#8220;IN_DELETE $filename\n&#8221;<br />
    #}<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marcos Athanasoulis		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-198367</link>

		<dc:creator><![CDATA[Marcos Athanasoulis]]></dc:creator>
		<pubDate>Thu, 29 Jan 2015 08:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-198367</guid>

					<description><![CDATA[This does not seem to be detecting deletion of files or directories (as noted in other comments), seems like the code should be working for that.  Has anyone gotten this to work for deletion?  It is working great for creates...]]></description>
			<content:encoded><![CDATA[<p>This does not seem to be detecting deletion of files or directories (as noted in other comments), seems like the code should be working for that.  Has anyone gotten this to work for deletion?  It is working great for creates&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jack Nond		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-85858</link>

		<dc:creator><![CDATA[Jack Nond]]></dc:creator>
		<pubDate>Mon, 22 Sep 2014 14:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-85858</guid>

					<description><![CDATA[Here&#039;s is a another simple watcher for directory trees: https://metacpan.org/pod/AnyEvent::Inotify::Simple#METHODS

It can easily be extended to watch deletion of file and folders too.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s is a another simple watcher for directory trees: <a href="https://metacpan.org/pod/AnyEvent" rel="nofollow ugc">https://metacpan.org/pod/AnyEvent</a>::Inotify::Simple#METHODS</p>
<p>It can easily be extended to watch deletion of file and folders too.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cory Albrecht		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-83640</link>

		<dc:creator><![CDATA[Cory Albrecht]]></dc:creator>
		<pubDate>Fri, 19 Sep 2014 05:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-83640</guid>

					<description><![CDATA[The -f check you do for the IN_DELETE and IN_MOVED_FROM will not work because at that point (firing of the inotify2 event) that pathname no longer exists. Your example daemon will never print out those two notices.

Also, you don&#039;t remove any watchers when a directory is deleted. :-)]]></description>
			<content:encoded><![CDATA[<p>The -f check you do for the IN_DELETE and IN_MOVED_FROM will not work because at that point (firing of the inotify2 event) that pathname no longer exists. Your example daemon will never print out those two notices.</p>
<p>Also, you don&#8217;t remove any watchers when a directory is deleted. 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yiorgos Stamoulis		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-5880</link>

		<dc:creator><![CDATA[Yiorgos Stamoulis]]></dc:creator>
		<pubDate>Thu, 23 Jan 2014 09:37:09 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-5880</guid>

					<description><![CDATA[Hi Johnny,

this is great, it work like a charm :-)

A small change you may consider:

&#062; use File::Basename;
&#062; my $basename = basename($0);
&#062; my $PID_FILE = &quot;/var/run/$basename.pid&quot;; 

otherwise it won&#039;t start unless you are in the same directory as the script itself

(I have added a init script an run it as a daemon at system startup)

Best Regards

Yiorgos]]></description>
			<content:encoded><![CDATA[<p>Hi Johnny,</p>
<p>this is great, it work like a charm 🙂</p>
<p>A small change you may consider:</p>
<p>&gt; use File::Basename;<br />
&gt; my $basename = basename($0);<br />
&gt; my $PID_FILE = &#8220;/var/run/$basename.pid&#8221;; </p>
<p>otherwise it won&#8217;t start unless you are in the same directory as the script itself</p>
<p>(I have added a init script an run it as a daemon at system startup)</p>
<p>Best Regards</p>
<p>Yiorgos</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Junaid		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-1872</link>

		<dc:creator><![CDATA[Junaid]]></dc:creator>
		<pubDate>Mon, 21 Oct 2013 12:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-1872</guid>

					<description><![CDATA[Hi there, First of all please accept my huge gratitude for providing this script, it is a great help and i was looking for something like this very desperately.
But as I haven&#039;t used perl before so i need your help regarding the error message i receive, when I try to invoke the script.
It says: 
&quot; Can&#039;t locate AnyEvent.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at notifier.perl line 6.
BEGIN failed--compilation aborted at notifier.perl line 6.&quot;
What do i need to do to fix this problem.
Secondly i wanted further help regarding
1. How to add more events. like &quot;File modification event&quot;
2. Connecting this script to a postgresql data for logging the events with corresponding timestamp to the database.

Many thanks once again for all the  help.

Cheers,

Malik Junaid]]></description>
			<content:encoded><![CDATA[<p>Hi there, First of all please accept my huge gratitude for providing this script, it is a great help and i was looking for something like this very desperately.<br />
But as I haven&#8217;t used perl before so i need your help regarding the error message i receive, when I try to invoke the script.<br />
It says:<br />
&#8221; Can&#8217;t locate AnyEvent.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at notifier.perl line 6.<br />
BEGIN failed&#8211;compilation aborted at notifier.perl line 6.&#8221;<br />
What do i need to do to fix this problem.<br />
Secondly i wanted further help regarding<br />
1. How to add more events. like &#8220;File modification event&#8221;<br />
2. Connecting this script to a postgresql data for logging the events with corresponding timestamp to the database.</p>
<p>Many thanks once again for all the  help.</p>
<p>Cheers,</p>
<p>Malik Junaid</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarakenidis Nikos		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-633</link>

		<dc:creator><![CDATA[Sarakenidis Nikos]]></dc:creator>
		<pubDate>Wed, 07 Nov 2012 15:38:48 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-633</guid>

					<description><![CDATA[It was 8192 in one of my ubuntu servers here.. I need &#062;250000]]></description>
			<content:encoded><![CDATA[<p>It was 8192 in one of my ubuntu servers here.. I need &gt;250000</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Johnny Morano		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-632</link>

		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Wed, 07 Nov 2012 15:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-632</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-631&quot;&gt;Sarakenidis Nikos&lt;/a&gt;.

Cool! It must be really huge then, cause overhere it is set by default to 65536:

# cat /proc/sys/fs/inotify/max_user_watches
65536

Cheers!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-631">Sarakenidis Nikos</a>.</p>
<p>Cool! It must be really huge then, cause overhere it is set by default to 65536:</p>
<p># cat /proc/sys/fs/inotify/max_user_watches<br />
65536</p>
<p>Cheers!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarakenidis Nikos		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-631</link>

		<dc:creator><![CDATA[Sarakenidis Nikos]]></dc:creator>
		<pubDate>Wed, 07 Nov 2012 14:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-631</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-630&quot;&gt;Sarakenidis Nikos&lt;/a&gt;.

OK I&#039;ve changed /proc/sys/fs/inotify/max_user_watches
and everything works as expected. My bad!

Cheers]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-630">Sarakenidis Nikos</a>.</p>
<p>OK I&#8217;ve changed /proc/sys/fs/inotify/max_user_watches<br />
and everything works as expected. My bad!</p>
<p>Cheers</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarakenidis Nikos		</title>
		<link>https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-630</link>

		<dc:creator><![CDATA[Sarakenidis Nikos]]></dc:creator>
		<pubDate>Wed, 07 Nov 2012 13:30:23 +0000</pubDate>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=905#comment-630</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-629&quot;&gt;Johnny Morano&lt;/a&gt;.

1. touch /data/vault/testfile
2. mkdir -p /data/vault/testdir
3. touch /data/vault/testdir/testfile

IN_CLOSE_WRITE /data/vault/testfile
Watching /data/vault/testdir

Third command does not produce any output

Is there a limit to the number of subdirectories inotify can watch? Cause mine is huge. Maybe that&#039;s the problem.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jmorano.moretrix.com/2012/10/recursive-inotify-daemon/#comment-629">Johnny Morano</a>.</p>
<p>1. touch /data/vault/testfile<br />
2. mkdir -p /data/vault/testdir<br />
3. touch /data/vault/testdir/testfile</p>
<p>IN_CLOSE_WRITE /data/vault/testfile<br />
Watching /data/vault/testdir</p>
<p>Third command does not produce any output</p>
<p>Is there a limit to the number of subdirectories inotify can watch? Cause mine is huge. Maybe that&#8217;s the problem.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
