https://rarforge.com/w/index.php?title=Xmbc&feed=atom&action=historyXmbc - Revision history2024-03-29T09:57:07ZRevision history for this page on the wikiMediaWiki 1.39.3https://rarforge.com/w/index.php?title=Xmbc&diff=670&oldid=prevRobertr: /* Inotify / Prowl - Watch Script */2013-04-19T23:40:17Z<p><span dir="auto"><span class="autocomment">Inotify / Prowl - Watch Script</span></span></p>
<p><b>New page</b></p><div>[[category:rarforge]]<br />
[[category:scripts]]<br />
[[category:perl]]<br />
[[category:htpc]]<br />
[[category:xbmc]]<br />
<br />
== Inotify / Prowl - Watch Script ==<br />
; Watch directory(s) - Update XMBC library on change and notify via Prowl<br />
* This script will watch a given directory(s) and sub directories for Video files (or any other files if needed)<br />
* If a file is created, it will update XBMC library<br />
* If a file is deleted, it will clean the XBMC library<br />
* It will notify via Prowl (if enabled)<br />
** It will group actions together if multiple (dirs/files) are created/deleted (default 60 seconds)<br />
<br />
Download: [[Media:xmbc_inotify.pl|xmbc_inotify.pl]]<br />
<br />
Download: https://www.prowlapp.com/static/prowl.pl * only required if you enable prowl notifications<br />
<br />
=== Start on Boot ===<br />
<br />
/etc/rc.local<br />
screen -dmS inotify /usr/local/bin/xbmc_inotify.pl<br />
<br />
<br />
<br />
'''Lang''' perl<br />
<br />
'''Modules''' <br />
use strict;<br />
use Linux::Inotify2;<br />
use Path::Class;<br />
use Number::Bytes::Human;<br />
use File::stat;<br />
use Data::Dumper;<br />
## JSON rpc call<br />
use LWP::UserAgent;<br />
use HTTP::Request;<br />
use JSON::PP;</div>Robertr