Jump to navigation Jump to search

Inotify / Prowl - Watch Script

Watch directory(s) - Update XMBC library on change and notify via Prowl
  • This script will watch a given directory(s) and sub directories for Video files (or any other files if needed)
  • If a file is created, it will update XBMC library
  • If a file is deleted, it will clean the XBMC library
  • It will notify via Prowl (if enabled)
    • It will group actions together if multiple (dirs/files) are created/deleted (default 60 seconds)

Download: xmbc_inotify.pl

Download: https://www.prowlapp.com/static/prowl.pl * only required if you enable prowl notifications

Start on Boot

screen -dmS inotify /usr/local/bin/xbmc_inotify.pl

Lang perl


use strict;
use Linux::Inotify2;
use Path::Class;
use Number::Bytes::Human;
use File::stat;
use Data::Dumper;
## JSON rpc call
use LWP::UserAgent;
use HTTP::Request;
use JSON::PP;