3 Commits

Author SHA1 Message Date
Rob Weber
be639387df updated README.txt 2012-11-28 11:27:13 -06:00
Rob Weber
3602bb5b6a added gui changes to be similar to Frodo branch 2012-11-28 11:22:02 -06:00
Rob Weber
f7c4a33c37 logged eden branch 2012-11-16 08:41:27 -06:00
7 changed files with 78 additions and 39 deletions

View File

@@ -3,18 +3,20 @@ XBMC Backup
About: 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. 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.
Usage: 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 month, day, year format so you can create multiple backups. 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.
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. 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.
To restore your data simply switch the Mode from "backup" to "restore" and type the date of the backup you wish to restore from . The files will be copied from your remote directory to the local path. The file selection criteria will be used for the restore as well.
Scheduling: 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. 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.
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.
What this Addon Will Not Do: 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 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.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmcbackup" <addon id="script.xbmcbackup"
name="XBMC Backup" version="0.1.7" provider-name="robweber"> name="XBMC Backup" version="0.1.9" provider-name="robweber">
<requires> <requires>
<import addon="xbmc.python" version="2.0"/> <import addon="xbmc.python" version="2.0"/>
</requires> </requires>

View File

@@ -1,20 +1,28 @@
[b]Version 0.1.7[/b] Version 0.1.9
added GUI changes to emulate Frodo look
Version 0.1.8
moved eden to new branch, frodo is now master
Version 0.1.7
minor bug fixes and translations updates minor bug fixes and translations updates
[b]Version 0.1.6[/b] Version 0.1.6
merged scheduler branch with master, can now schedule backups on an interval merged scheduler branch with master, can now schedule backups on an interval
[b]Version 0.1.5[/b] Version 0.1.5
pulled xbmcbackup class into separate library pulled xbmcbackup class into separate library
[b]Version 0.1.4[/b] Version 0.1.4
added more verbose error message for incorrect paths added more verbose error message for incorrect paths
[b]Version 0.1.3[/b] Version 0.1.3
backup folder format - thanks zeroram backup folder format - thanks zeroram
@@ -26,53 +34,53 @@ updated utf-8 encoding for all logging
backup now uses date as folder name, restore allows user to type date of last backup backup now uses date as folder name, restore allows user to type date of last backup
[b]Version 0.1.2[/b] Version 0.1.2
added French language translation - thanks mikebzh44 added French language translation - thanks mikebzh44
added some utf-8 encoding tags to filenames added some utf-8 encoding tags to filenames
[b]Version 0.1.1[/b] Version 0.1.1
added check for key in vfs.py - Thanks Martijn! added check for key in vfs.py - Thanks Martijn!
[b]Version 0.1.0[/b] Version 0.1.0
removed transparency from icon.png removed transparency from icon.png
[b]Version 0.0.9 [/b] Version 0.0.9
modified vfs.py again to filter out xsp files (smart playlists). Created running list for these types of compressed files modified vfs.py again to filter out xsp files (smart playlists). Created running list for these types of compressed files
added enable/disable logging toggle in settings added enable/disable logging toggle in settings
[b]Version 0.0.8[/b] Version 0.0.8
modified vfs.py script to exclude handling zip files as directories, added keymap and peripheral data folders in the "config" section modified vfs.py script to exclude handling zip files as directories, added keymap and peripheral data folders in the "config" section
[b]Version 0.0.7[/b] Version 0.0.7
removed "restore.txt" file and now write file listing to memory list instead removed "restore.txt" file and now write file listing to memory list instead
[b]Version 0.0.6[/b] Version 0.0.6
Added the vfs module created by paddycarey Added the vfs module created by paddycarey
File Selection is now followed for both backup and restore options File Selection is now followed for both backup and restore options
[b]Version 0.0.5[/b] Version 0.0.5
Added option to manually type a path rather than browse for one (only one used) Added option to manually type a path rather than browse for one (only one used)
Show progress bar right away so you know this is doing something Show progress bar right away so you know this is doing something
[b]Version 0.0.4[/b] Version 0.0.4
Finished code for restore mode. Finished code for restore mode.
[b]Version 0.0.3[/b] Version 0.0.3
Added progress bar and "silent" option for running on startup or as a script Added progress bar and "silent" option for running on startup or as a script
[b]Version 0.0.2[/b] Version 0.0.2
First version, should backup directories as needed First version, should backup directories as needed

View File

@@ -1,7 +1,21 @@
import xbmcgui
import resources.lib.utils as utils
from resources.lib.backup import XbmcBackup from resources.lib.backup import XbmcBackup
#run the profile backup #figure out if this is a backup or a restore
backup = XbmcBackup() mode = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30023),[utils.getString(30016),utils.getString(30017)])
if(backup.isReady()): if(mode != -1):
backup.run() #run the profile backup
backup = XbmcBackup()
if(mode == backup.Restore):
#allow user to select the backup to restore from
restorePoints = backup.listBackups()
selectedRestore = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30021),restorePoints)
if(selectedRestore != -1):
backup.selectRestore(restorePoints[selectedRestore])
backup.run(mode)

2
resources/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.pyo

View File

@@ -87,6 +87,7 @@ class XbmcBackup:
filesTotal = 1 filesTotal = 1
fileManager = None fileManager = None
restore_point = None
def __init__(self): def __init__(self):
self.local_path = xbmc.makeLegalFilename(xbmc.translatePath("special://home"),False); self.local_path = xbmc.makeLegalFilename(xbmc.translatePath("special://home"),False);
@@ -106,27 +107,43 @@ class XbmcBackup:
utils.log(utils.getString(30046)) utils.log(utils.getString(30046))
def run(self,mode=-1,runSilent=False): def listBackups(self):
#check if we should use the progress bar result = list()
if(utils.getSetting('run_silent') == 'false' and not runSilent):
self.progressBar = xbmcgui.DialogProgress()
self.progressBar.create(utils.getString(30010),utils.getString(30049) + "......")
#determine backup mode #get all the folders in the current root path
if(mode == -1): dirs = vfs.listdir(self.remote_path)
mode = int(utils.getSetting('addon_mode'))
for aDir in dirs:
result.append(aDir[len(self.remote_path):-1])
return result
def selectRestore(self,restore_point):
self.restore_point = restore_point
def run(self,mode=-1,runSilent=False):
#append backup folder name #append backup folder name
progressBarTitle = utils.getString(30010) + " - "
if(mode == self.Backup and self.remote_path != ''): if(mode == self.Backup and self.remote_path != ''):
self.remote_path = self.remote_path + time.strftime("%Y%m%d") + "/" self.remote_path = self.remote_path + time.strftime("%Y%m%d") + "/"
elif(mode == self.Restore and utils.getSetting("backup_name") != '' and self.remote_path != ''): progressBarTitle = progressBarTitle + utils.getString(30016)
self.remote_path = self.remote_path + utils.getSetting("backup_name") + "/" elif(mode == self.Restore and self.restore_point != None and self.remote_path != ''):
self.remote_path = self.remote_path + self.restore_point + "/"
progressBarTitle = progressBarTitle + utils.getString(30017)
else: else:
#kill the program here
self.remote_path = "" self.remote_path = ""
return
utils.log(utils.getString(30047) + ": " + self.local_path) utils.log(utils.getString(30047) + ": " + self.local_path)
utils.log(utils.getString(30048) + ": " + self.remote_path) utils.log(utils.getString(30048) + ": " + self.remote_path)
#check if we should use the progress bar
if(utils.getSetting('run_silent') == 'false' and not runSilent):
self.progressBar = xbmcgui.DialogProgress()
self.progressBar.create(progressBarTitle,utils.getString(30049) + "......")
#run the correct mode #run the correct mode
if(mode == self.Backup): if(mode == self.Backup):
utils.log(utils.getString(30023) + " - " + utils.getString(30016)) utils.log(utils.getString(30023) + " - " + utils.getString(30016))
@@ -206,5 +223,3 @@ class XbmcBackup:
return result return result
def isReady(self):
return True if self.remote_path != '' else False

View File

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings> <settings>
<category id="general" label="30011"> <category id="general" label="30011">
<setting id="addon_mode" type="enum" lvalues="30016|30017" default="0" label="30023" />
<setting id="remote_selection" type="enum" lvalues="30018|30019" default="0" label="30025"/> <setting id="remote_selection" type="enum" lvalues="30018|30019" default="0" label="30025"/>
<setting id="remote_path_2" type="text" label="30024" default="" visible="eq(-1,1)" /> <setting id="remote_path_2" type="text" label="30024" default="" visible="eq(-1,1)" />
<setting id="remote_path" type="folder" label="30020" visible="eq(-2,0)" /> <setting id="remote_path" type="folder" label="30020" visible="eq(-2,0)" />
<setting id="backup_name" type="text" label="30021" default="backup_date" visible="eq(-4,1)"/>
<setting id="run_silent" type="bool" label="30022" default="false" /> <setting id="run_silent" type="bool" label="30022" default="false" />
</category> </category>
<category id="selection" label="30012"> <category id="selection" label="30012">