<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m trying to figure a way to keep the MythVideo list updated, whenever I add or remove a video from the mythvideo directory.  The videos folder is on the primary backend system (version 0.26), and I maintain the videos folder from my Windows machine via samba.<br>



<br>I originally tried to add &quot;postexec =/usr/bin/mythutil --scanvideos&quot;  to the smb.conf file, but I was unable to get it to work properly.  It either wouldn&#39;t work, or Windows would keep the connection to the share open long after I added files and closed the share window.<br>



<br>I tried using inotifywait, which yielded much better results.  However, I was only able to get it to work while in a terminal, which I found difficult to automate on reboots<br><br>I was able to get it working with incrond, but doesn&#39;t recursively monitor the folder.<br>



<br>Does anyone know of a better way to monitor the videos directory?  I know that I could run the mythutil in cron every minute, but I would prefer a more elegant solution.</blockquote><div><br></div><div><br></div><div style>

You could try dnotify, it has a recurse switch..</div><div style><br></div><div style>While only slightly more elegant than running mythutil every minute, you could use a cron job that runs every few minutes that dumps a recursive directory listing to a file then compares (cmp -s) the file to a previous copy; if different (exit code 1) triggers the update.  This would likely be a very lightweight operation, and would catch any changes within the folder.</div>

<div style><br></div><div style> </div></div></div></div>