Backing Up my XBMC Library
#1
Question 
I would like to know how to backup my XBMC library for future use. I am running XBMC on my Revo (using the guide here: http://forum.xbmc.org/showthread.php?tid=53888) so if I would have to delete or reinstall XBMC, I would like to keep all my custom movie posters, fan art, and fixed names on my movies, TV shows, and iTunes music.

I spent alot of time cleaning up my library, especially with fixing movie names that did not scan in correctly, and with movie artwork. So this is why I am asking if there is a way to back it all up and restore it to that exact same point. Smile

Thanks!!
Reply
#2
The userdata directory in ~/.xbmc should contain everything (aside from your media obviously) so if you make a copy of this and put it somewhere safe every so often you should be fine.
[Image: output.jpg]
Reply
#3
OK perfect, so TV thumbnails, fanart, movie names, the whole 9 yards...
I will try it out, thanks!

Do you know of a plugin for XBMC that can do this automatically, say every time I bootup?
Reply
#4
revlimiter Wrote:OK perfect, so TV thumbnails, fanart, movie names, the whole 9 yards...
I will try it out, thanks!

Do you know of a plugin for XBMC that can do this automatically, say every time I bootup?

You could probably accomplish something like this with a script within linux run at bootup.
Reply
#5
Hmmm, I'm not too familiar with Linux - do you mean in Terminal?
I think XBMC Live is running on Ubuntu (?) but I'm not sure how to access Ubuntu? Or if I even have that part correct. If anyone can help be build this script that would be greatly appreciated.

Thanks!
Reply
#6
This could easily be done using crontab. From the terminal enter sudo nano /etc/crontab and add the following:

Quote:0 15 * * * root tar czf /usr/local/backups/daily/userdata.tar.gz ~/.xbmc/userdata >> /dev/null 2>&1

would create a daily backup of your userdata folder in a tarball at 15 minutes after midnight everyday. I copied a bit of this code from another site, and it's 2:15 am where I'm at, so I might have a bit of it wrong. Hopefully someone will fix my screwup.
Reply
#7
cowfodder Wrote:This could easily be done using crontab. From the terminal enter sudo nano /etc/crontab and add the following:



would create a daily backup of your userdata folder in a tarball at 15 minutes after midnight everyday. I copied a bit of this code from another site, and it's 2:15 am where I'm at, so I might have a bit of it wrong. Hopefully someone will fix my screwup.

Does this archive backups or overwrite the old backup, as if it overwrites the old backup and you do it every day and something goes wrong with the database you can end up with a backup of a corrupt database Smile
Reply
#8
I think it would overwrite daily.

Quote:0 15 * * * root tar czf /usr/local/backups/daily/userdata`date +\%F`.tar.gz ~/.xbmc/userdata >> /dev/null 2>&1

or

Quote:0 15 * * * root tar czf /usr/local/backups/daily/userdata`date +\%Y\%m\%d_\%H\%M\%S`.tar.gz ~/.xbmc/userdata >> /dev/null 2>&1

should add the date. The one problem with this solution is that it will fill up your HD really quickly. Another crontab entry could be made to delete backups older than a certain time frame:

Quote:* * * * 7 /usr/bin/find /usr/local/backups/daily -mtime +7 -depth -mindepth 1 -delete

should automatically delete all backups older than 7 days, and run every Sunday.

I forgot to mention in my first post, you need to make sure the /usr/local/backups/daily folder exists for the backups to work.

Quote:sudo mkdir /usr/local/backups/daily
Reply
#9
I'd recommend just going to Settings -> Video Library -> Export Library, and choose separate files for everything. This will accomplish what you're looking for by making files beside your videos containing artwork, info, etc, that will automatically scan into a library in case your current one dies. It works great.
Reply
#10
TheDuffMan Wrote:I'd recommend just going to Settings -> Video Library -> Export Library, and choose separate files for everything. This will accomplish what you're looking for by making files beside your videos containing artwork, info, etc, that will automatically scan into a library in case your current one dies. It works great.

A good point. There is an exportlibrary function that could be used in crontab for automation, but I'm not sure exactly how it works.

Something along the lines of
Quote:curl "http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.exportlibrary(music|video,true,thumbs,overwrite,actorthumbs)

but I'm sure I'm missing something in there.
Reply
#11
Thanks everyone!

I'll go with TheDuffMan's method since it seems to be the easiest method. It would be sweet if there was an option in XBMC to do this automatically every time it boots up. I don't leave my Revo on 24/7 so I don't think the timed backup will work effectively.
Reply
#12
OK I made a backup and selected save individually instead of collectively as one file. But where do the file(s) get saved? I got the assumption that they would be saved in the same directory as the movies and TV shows (on my network hdd). Are the files saved on my Revo within a directory? And can I change where these files get saved to?

Thanks!
Reply
#13
Your assumption is correct... when I export, the tbn, fanart, nfo files get placed alongside wherever the media is saved. I also use a networked drive. Did the export finish? Maybe you should post a debug log.
Reply
#14
How do I post a debug log?
Is there a way I can set this manually for my movies and TV shows? And/or a program for Mac that can do this for my files instead of going through the XBMC export library tool?
Thanks!
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Backing Up my XBMC Library00