[mythtv-users] Keeping the MythVideo db up2date

Joseph Fry joe at thefrys.com
Tue Apr 9 17:39:11 UTC 2013


> I'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.
>
> I originally tried to add "postexec =/usr/bin/mythutil --scanvideos"  to
> the smb.conf file, but I was unable to get it to work properly.  It either
> wouldn't work, or Windows would keep the connection to the share open long
> after I added files and closed the share window.
>
> 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
>
> I was able to get it working with incrond, but doesn't recursively monitor
> the folder.
>
> 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.



You could try dnotify, it has a recurse switch..

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130409/93eefc69/attachment.html>


More information about the mythtv-users mailing list