Cron job to tell XBMC to update video library

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
marcozd Offline
Senior Member
Posts: 145
Joined: Nov 2008
Reputation: 0
Question  Cron job to tell XBMC to update video library Post: #1
Hello all,

I am wondering if there is a way to setup a cron job or something similar that would tell XBMC to scan the video directories for new content and then add new content if it was found?

I realize that this can be set-up to run every time that XBMC starts, but if the system is consonantly on or put in sleep mode, then this is not a valid option.

Thanks

Case: Silverstone Grandia GD04B Black PSU: Seasonic X-400FL 400 W Fanless CPU:Intel 2100 3.1 Ghz CPU Cooler: Scythe Big Shuriken Low Profile RAM:Corsair 4 GB DD3-133 Mobo: Gigabyte H67M-D2-B3 mATX OS HDD: Corsair Nova Series 32GB SSD Storage HDD: WD Green 2 TB Video Card: ASUS EN210 SILENT ODD: Liteon 24X DVD WriterIR: CommandIR Mini

Secondary Box: Original Xbox Softmodded with Krayzie, 500 GB HDD
find quote
marcozd Offline
Senior Member
Posts: 145
Joined: Nov 2008
Reputation: 0
Post: #2
FOund it on the forums I think.

I apologize for this unnecessary post

Case: Silverstone Grandia GD04B Black PSU: Seasonic X-400FL 400 W Fanless CPU:Intel 2100 3.1 Ghz CPU Cooler: Scythe Big Shuriken Low Profile RAM:Corsair 4 GB DD3-133 Mobo: Gigabyte H67M-D2-B3 mATX OS HDD: Corsair Nova Series 32GB SSD Storage HDD: WD Green 2 TB Video Card: ASUS EN210 SILENT ODD: Liteon 24X DVD WriterIR: CommandIR Mini

Secondary Box: Original Xbox Softmodded with Krayzie, 500 GB HDD
find quote
cowfodder Offline
Fan
Posts: 386
Joined: Jan 2010
Reputation: 2
Post: #3
The cron job is the old way, there's now an autoupdate addon in the repos that works much better. I have one that updates whenever something is added to my movie or tv folder, and one that cleans the library whenever something is deleted.
find quote
NeoDuck Offline
Junior Member
Posts: 49
Joined: May 2010
Reputation: 0
Post: #4
(2011-04-07 22:22)cowfodder Wrote:  The cron job is the old way, there's now an autoupdate addon in the repos that works much better. I have one that updates whenever something is added to my movie or tv folder, and one that cleans the library whenever something is deleted.

Where can we find the auto-update addon? I'm running version 11-RC2 and the Update Library feature never works. Whenever I select it, it goes thru the motions of scanning for new content on my video sources, but it never detects anything new. I always have to go into Video > Files, and then right-click each source and scan for new content. That's the only way it works for me, Library Update doesn't do anything. Sad

Thanks!
(This post was last modified: 2012-05-08 04:38 by NeoDuck.)
find quote
TugboatBill Offline
Posting Freak
Posts: 788
Joined: Oct 2009
Reputation: 3
Post: #5
FWIW, you could set up XBMC to scan on startup and then add a cron job that runs "shutdown -r now".
find quote
drivesoslow Offline
Fan
Posts: 372
Joined: Aug 2008
Reputation: 4
Post: #6
FWIW I still use cron to update and clean my library. I have it scan for new video files every 15 minutes, new music nightly, and I have it clean both libraries nightly.

Code:
*/15    *       *       *       *       /usr/bin/curl 'http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)'
0       1       *       *       *       /usr/bin/curl 'http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.cleanlibrary(video)'
0       3       *       *       *       /usr/bin/curl 'http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(music)'
0       2       *       *       *       /usr/bin/curl 'http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.cleanlibrary(music)'
find quote
Aenima99x Offline
Member+
Posts: 1,030
Joined: Aug 2007
Reputation: 7
Location: California
Post: #7
You should check out the Library Watchdog service addon. It runs in the background and automatically updates the video library as soon as new files are added. It's only video right now, but I've asked the dev if he can add in the music library as well. http://forum.xbmc.org/showthread.php?tid=128896
find quote