Directory Watchdog - Background file monitor service to initiate auto update library?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sireone Offline
Junior Member
Posts: 38
Joined: Jun 2009
Reputation: 3
Lightbulb  Directory Watchdog - Background file monitor service to initiate auto update library?
Post: #1
I've been searching and searching and it seems that one feature that needs to be implemented in the next update is Automatically Updating of the video library in XBMC Live!. They took one step forward and added 'Update on Startup', but what we really need is updating at specified intervals.

I did some searching and found some scripts (based on xbmc-eventclients-xbmc-send), but then realized that Camelot 9.11 does not contain cron.

If anyone has any ideas, lemme know,

Thanks,
find quote
hikaricore Offline
Posting Freak
Posts: 1,515
Joined: Dec 2008
Reputation: 0
Location: Tuesday
Post: #2
Why not just map an unused button on your remote?
Does the trick for me.

[Image: output.jpg]
find quote
althekiller Offline
Team-XBMC Developer
Posts: 4,930
Joined: May 2004
Reputation: 12
Post: #3
Install cron, live is just a stripped ubuntu.
find quote
robweber Online
Posting Freak
Posts: 818
Joined: Sep 2009
Reputation: 26
Post: #4
While the suggested solutions all 'work', the fact remains that it requires some additional setup (some platform dependent) for something that could easily be solved with a setting in XBMC where you set the time of day and it just does it.
find quote
sireone Offline
Junior Member
Posts: 38
Joined: Jun 2009
Reputation: 3
Post: #5
Am i missing something here?

Quote:xbmc@XBMCLive:~$ sudo apt-get install cron
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package cron
xbmc@XBMCLive:~$ sudo apt-get install crond
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package crond
xbmc@XBMCLive:~$
find quote
wstewart Offline
Senior Member
Posts: 212
Joined: Jan 2009
Reputation: 1
Location: Canada
Post: #6
cron is the package.

Did you do

apt-get update

Must be something wrong with your sources. Check /etc/apt/sources.list
find quote
sireone Offline
Junior Member
Posts: 38
Joined: Jun 2009
Reputation: 3
Post: #7
That did it! Once I ran 'apt-get update' I was able to run 'apt-get install cron'

Thanks,
find quote
outleradam Offline
Donor
Posts: 1,721
Joined: Sep 2009
Reputation: 20
Location: Louisiana
Post: #8
no need to install cron
get curl. it's more fun. curl provides terminal based web access.
Code:
apt-get install curl
make a script like this

Code:
#! /bin/bash

#FOR ((EVER))
for (( ; ; ))
#Loop
do
#sleep for 1 hour
sleep 3600
#send command to XBMC to update video library
curl "http://"$XBMCIP"/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))"
done
exit 0
make it executable
Code:
chmod +x /path/to/myscript.sh
then place it in /etc/init.d

Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[Image: newsig-1.png]
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
find quote
The-Boxhead Offline
Donor
Posts: 958
Joined: May 2005
Reputation: 17
Location: Norway
Post: #9
Why all this would work the best way to do it would be that XBMC
had this "built in" in feature rels.

Regular users dont expect to setup scripts, mapping custom keymaps, hacking skins or whatever.

There should be some kinda "monitor" functions on all sources added. When
XBMC senses a change in any of the sources it updates them, and movies / music or whatever is automaticly scanned into the library.

Most "library" programs on PC/MAC has this functions and users are used to it.

PointOfView Nvidia ION Atom 330 - TRANSCEND 2GB DDR2 DIMM 800MHz - G.SKILL 64GB SSD 2.5
Open Elec Beta4 1.95.4
XBMC Online Manual - HOW-TO post about a problem in a useful manner - Create/View Bug Report
Setup/Fix correct resolution on XBMC/Ubuntu - Usefull linux terminal commands
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #10
robweber, then send us the simple diff. i mean, it's just adding a setting to the gui and poof it does it automagically, eh.
find quote
robweber Online
Posting Freak
Posts: 818
Joined: Sep 2009
Reputation: 26
Post: #11
spiff Wrote:robweber, then send us the simple diff. i mean, it's just adding a setting to the gui and poof it does it automagically, eh.

I probably shouldn't be throwing around the word 'easily'. I guess I was thinking easy for the user when it is done, not trying to setup all sorts of other scripts and download packages.

I do like the idea though and may attempt something, whether it works or not will be a different story. I'll post a link to the ticket here if I come up with anything remotely usable.
find quote
outleradam Offline
Donor
Posts: 1,721
Joined: Sep 2009
Reputation: 20
Location: Louisiana
Post: #12
I have mythicalLibrarian set up to automatically update all xbmc servers on the network when a new recording is generated and added to my NAS. Not everyone has the same setup so there is no single soloution. There is no single command.

Xbmc could DIR > file.log and compare it to the last file.log and update if new file size is not equal to old file size. That would be supported on all platforms. It may get very slow on large libraries though

Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[Image: newsig-1.png]
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #13
well, that's what update library does internally - in somewhat more sophisticated ways though. what is needed is a directory watchdog, problem with that is there is no cross platform solution.
find quote
banan Offline
Junior Member
Posts: 28
Joined: Oct 2008
Reputation: 0
Post: #14
spiff Wrote:well, that's what update library does internally - in somewhat more sophisticated ways though. what is needed is a directory watchdog, problem with that is there is no cross platform solution.

@spiff: What about Python? Look here for how sabnzbd handle it (*nix, osx, win): http://trac2.assembla.com/SABnzbd/browse...scanner.py
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #15
banan, that's an option and in line with what i have been saying for years and years on end - adding this to the core makes no sense.
find quote
Post Reply