• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8
Directory Watchdog - Background file monitor service to initiate auto update library?
#61
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?

Thanks
Alex
Reply
#62
alexcampo Wrote: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?

Thanks
Alex

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?
Reply
#63
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.
Thanks
Reply
#64
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?
Reply
#65
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.
Reply
#66
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.

Christian...
Reply
#67
http://trac.xbmc.org/ticket/9056
Reply
#68
queeup Wrote:http://trac.xbmc.org/ticket/9056

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.
Reply
#69
queeup Wrote:http://trac.xbmc.org/ticket/9056
why 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
Reply
#70
ventech Wrote:why 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

And now we've come full circle....

http://forum.xbmc.org/showpost.php?p=479...stcount=21
http://forum.xbmc.org/showpost.php?p=485...stcount=34
http://forum.xbmc.org/showpost.php?p=485...stcount=35

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.
Reply
#71
ok. thats all i wanted to know
Reply
#72
robweber Wrote: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.

I disagree. Watching a directory means in essence always running a timer. It is easier for XBMC development but not the best use of resources. The user does something to create the new content. Let the user build the update (via a call to the already-present update functionality) as part of their process.

For example, I often backup a few movies from DVD, copy them to the appropriate directories and run the library update once via curl.
Reply
#73
Information 
Hey folks,
I have written a little watchdog script using inotify and xbmc-send. It is just working on Linux (of course ^^) and seems to do well.
You can get it here.
I use it on a Ubuntu 10.04 Lucid machine running XBMC as standalone and I use to copy files with rsync (so there is a special feature in the script not to trigger on rsync temp files).
Reply
#74
Double post
Reply
#75
DerDome Wrote:Hey folks,
I have written a little watchdog script using inotify and xbmc-send. It is just working on Linux (of course ^^) and seems to do well.
You can get it here.
I use it on a Ubuntu 10.04 Lucid machine running XBMC as standalone and I use to copy files with rsync (so there is a special feature in the script not to trigger on rsync temp files).

So I just run this script once lets say by adding ./monitorscript to bash_login . Will it continue to run endlessley, I didn’t understand all the code but there doesn’t seem to be a loop.

Also it seems I need inotify which you don't mention. I can't find this in the repositories, where does it come from? Can this script be run as a daemon?
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8

Logout Mark Read Team Forum Stats Members Help
Directory Watchdog - Background file monitor service to initiate auto update library?1