Backup Addon for Kodi
Go to file
2013-03-04 10:33:27 -06:00
resources updated settings.xml to 2 custom sources with enable/disable 2013-03-04 10:33:27 -06:00
addon.xml updated readme and version 2013-01-29 11:32:47 -06:00
changelog.txt updated readme and version 2013-01-29 11:32:47 -06:00
default.py will now check for arguments "backup" or "restore" to bypass dialog prompt 2013-01-04 10:29:00 -06:00
icon.png added french language translations and new icon - Thanks to mikebzh44 2012-08-01 14:49:40 -05:00
LICENSE.txt first commit - kind of works 2012-04-17 16:03:45 -05:00
README.txt Merge pull request #28 from robweber/testing 2013-03-04 08:29:05 -08:00
scheduler.py fixed shutdown function in scheduler.py 2012-12-30 15:19:17 -06:00

XBMC Backup

DISCLAIMER: It has been well documented in the XBMC forum that not using a separate, backups only, directory can result in other non-backup files being deleted when the backup rotation clean operation runs. This is a known bug, and for now the only fix is to not mix your backup data in the same folder as other files. Once this is fixed it will cease to be a problem. Keep this in mind when setting your backup destination - you have been warned. 

About: 
I've had to recover my database, thumbnails, and source configuration enough times that I just wanted a quick easy way to back them up. That is what this addon is meant to do. 

Remote Destination/File Selection: 

In the addon settings you can define a remote path for the destination of your xbmc files. Each backup will create a folder named in a YYYYMMDD format so you can create multiple backups. You can keep a set number of backups by setting the integer value of the Backups to Keep setting greater than 0. 

On the Backup Selection page you can select which items from your user profile folder will be sent to the backup location. By default all are turned on except the Addon Data directory. 

You can also define non-XBMC directories on your device. See "Custom Directories" for more information on how these are handled. 

Scheduling: 

You can also schedule backups to be completed on a set interval via the scheduling area. When it is time for the backup to run it will be executed in the background. 

When using the "Shutdown" function this will call XBMC's Shutdown method as defined in System Settings -> Power Saving -> Shutdown Function. This can be simply exiting xbmc, hibernating, or shutting down your htpc. 

Running the Program:

Running the program will allow you to select Backup or Restore as a running mode. Selecting Backup will push files to your remote store using the addon settings you defined. Selecting Restore will give you a list of restore points currently in your remote destination. Selecting one will pull the files matching your selection criteria from the restore point to your local XBMC folders. 

Custom Directories: 

You can define custom directories that are not a part of your XBMC folder structure for backup. These create a custom_1_hash folder in your backup destination. The hash for these folders is very important. During a restore if the hash of the file path in Custom 1 does not match the hash in the restore folder it will not move the files. This is to prevent files from being restored to the wrong location in the event you change file paths in the addon settings. A dialog box will let you know if file paths do not match up. 


Using Dropbox:

Using Dropbox as a storage target adds a few steps the first time you wish to run a backup. First you will need to sign-up for you own developer app key and secret by visiting https://www.dropbox.com/developers. Name your app whatevery you want, and make it an "App Folder" type application. Your app can run in developer mode and you should never need to apply for production status. This is to get around Dropbox's rule not allow distribution of production key/secret pairs. 

Once you have your app key and secret add them to the settings. XBMC Backup now needs to have permission to access your Dropbox account. When you see the prompt regarding the Dropbox URL Authorization DO NOT click OK. Check your XBMC log file for a line from "script.xbmcbackup" containing the authorization URL. Cut/paste this into a browser and click Allow. Once this is done you can click "OK" in XBMC and proceed as normal. XBMC Backup will cache the authorization code so you only have to do this once, or if you revoke the Dropbox permissions. 


Scripting XBMC Backup: 

If you wish to script this addon using an outside scheduler or script it can be given parameters via the Xbmc.RunScript() or JsonRPC.Addons.ExecuteAddon() methods. Parameters given are either "backup" or "restore" to launch the correct program mode. An example would be: 

RunScript(script.xbmcbackup,backup)


What this Addon Will Not Do:

This is not meant as an XBMC file sync solution. If you have multiple frontends you want to keep in sync this addon may work in a "poor man's" sort of way but it is not intended for that. 

This backup will not check the backup destination and delete files that do not match. It is best to only do one backup per day so that each folder is correct.