Directory Watchdog - Background file monitor service to initiate auto update library? - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Feature Suggestions (/forumdisplay.php?fid=9)
+--- Thread: Directory Watchdog - Background file monitor service to initiate auto update library? (/showthread.php?tid=66348)
- alexcampo - 2010-02-08 15:19
Does XBMC need to be running for this cron job to work?
I wake my PC with the internal clock and do some batches - but XBMC is not running - is there a way to start xbmc as well as part of these cron jobs?
- robweber - 2010-02-08 17:30
alexcampo Wrote:Does XBMC need to be running for this cron job to work?
Yes, XBMC needs to be running for the http calls that will update the library to work.
when you say XBMC is off, do you mean the program is not running on the computer, or that the entire HTPC is shutdown? If the program is not running then you could just add some commands to launch it. If it is the whole HTPC you'll need to wake it up either via a timer or wake on lan or something.
Another question - if XBMC is not running, why not just enable the update on startup setting and save yourself the hassle of running the cron job when it is not on?
- alexcampo - 2010-02-08 21:49
Hi - the PC itself is on.
It wakes up to run other jobs (4am)
the PC is running Mythbuntu and mythbackend/frontend. I recently added xbmc as an option from the myth menus to run when I want to watch videos (xbmc is the best video player/manager I know).
Therefore I don't need/want to run xbmc at start up. But I'd like to know what commands I would need to get it run - so I can then send the update library - then kill xbmc and the pc finishes it's other jobs (epg data fill etc) and shuts down. That way - any of my video files that also get automatically copied the PC - could be added to the library.
It's more for convenience, so that when I turn on the PC (in the evening after work etc) and choose xbmc from the myth menu - the latest files are there and I don't need to have update at startup.
The PC switches on for about 1 hour or so to run it's jobs, and sure I can also envoke it to run xbmc ?
any help would be appreciated.
- takoi - 2010-04-10 13:26
so what was the conclusion? there's already several features that's live only so what exactly is the problem implementing something using, lets say, inotify?
- GJones - 2010-04-15 19:30
As a software developer (by profession, not for XBMC), I am going to weigh in here. Watching directories might seem like an easy way to do this but it is not the brightest use of resources. You are initiating an action to get the movie/tv show/video there. Why not update the library when you actively put the content into the directory. If you do not want to put the burden on the person putting the content into the directory, run a cron job. The documentation above regarding cron will do a fine job or automating the process.
If you are worried about the machine being turned off, then have it update the library at startup. If you don't want it to update at startup, leave the machine on or make sure the cron runs when it is normally on. You cannot have your cake and eat it too.
- ChristianW - 2010-04-16 09:42
Not to spank an old thread...
But any type of "automatic-thingy-that-may-or-may-not-take-a-while-to-complete" should be avoided... I haven't seen a single usecase yet that couldn't be resolved from the other end. Most download-clients (torrent/usenet/whatever) give you an option to execute a script when the download is complete. Make this script trigger the databaseupdate. If your XBMC-client isn't online at the time, just have it autoupdate on boot. This should cover most of the usecases.
I do agree that a decentralized db is the way forward, but this adds several new issues (relative network paths and such), besides, I think they are already working on it.
- queeup - 2010-04-16 16:10
- robweber - 2010-04-16 17:25
Your ticket asks for a lot of features that this patch already covers. may be a good start for someone interested in this: http://trac.xbmc.org/ticket/8431. Only difference on this one is that the users specifies a time rather than daily, frequently, etc.
- takoi - 2010-04-16 19:52
queeup Wrote:http://trac.xbmc.org/ticket/9056why anyone would need 'daily' when you can have 'frequently' is beyond me..
anyway; rescanning the whole filesystem each time looking for changes is very inefficient. callback on filesystem level is definitely the preferable solution. and as a bonus you dont have to deal with dupes when renaming and moving files anymore
- robweber - 2010-04-16 20:38
ventech Wrote:why anyone would need 'daily' when you can have 'frequently' is beyond me..
And now we've come full circle....
the big problem with doing this is that the 'best' way, which is to watch the directory, is difficult to implement cross-platform; so your best bet is an outside utility. The other less efficient way is a timer. Although it works, it works so poorly that adding it to the core seems counter productive. So we end up stuck with the outside scripts, cron jobs, and such.