Kodi Community Forum
[Release] Backup (formerly XBMC Backup) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [Release] Backup (formerly XBMC Backup) (/showthread.php?tid=129499)



RE: [Release] XBMC Backup - robweber - 2012-07-24

Does XBMC crash or just the addon? The log file looks like it just ends while trying to write an image file.

Try doing a backup to a local directory and see if it completes then (if that works, do a backup over the top of that one too). It may be a problem writing to the NFS Share. The entire backup should not disappear if files have been written.


RE: [Release] XBMC Backup - mikebzh44 - 2012-07-25

With 0.1.0 version, I was able to backup my smart playlists but now, I get an issu with ZIP files :

Code:
14:46:46 T:2955926336  NOTICE: Thread XBPyThread start, auto delete: false
14:46:46 T:2955926336  NOTICE: -->Python Interpreter Initialized<--
14:46:46 T:2955926336  NOTICE: script.xbmcbackup: Starting
14:46:46 T:2955926336  NOTICE: script.xbmcbackup: Local Dir: /storage/.xbmc/
14:46:46 T:2955926336  NOTICE: script.xbmcbackup: Remote Dir: /var/media/DONNEES/xbmc_backup/
14:46:46 T:2955926336  NOTICE: script.xbmcbackup: Remote Path exists - may have old files in it!
14:46:46 T:2955926336  NOTICE: script.xbmcbackup: Creating Files List
14:46:47 T:2955926336   ERROR: GetDirectory - Error getting zip:///storage/.xbmc/addons/web.browser.opera/opera12/share/opera/locale/en/en.zip/
14:46:47 T:2955926336   ERROR: Error Type: <type 'exceptions.KeyError'>
14:46:47 T:2955926336   ERROR: Error Contents: 'result'
14:46:47 T:2955926336   ERROR: Traceback (most recent call last):
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 199, in <module>
                                                backup.run()
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 123, in run
                                                self.syncFiles()
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 137, in syncFiles
                                                self.fileManager.createFileList(self.Addon)
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 28, in createFileList
                                                self.walkTree(self.walk_path + "addons/")
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 62, in walkTree
                                                for (path, dirs, files) in vfs.walk(directory):
                                              File "/storage/.xbmc/addons/script.xbmcbackup/resources/lib/vfs.py", line 52, in walk
                                                for x in listdir(current_path, extra_metadata=True):
                                              File "/storage/.xbmc/addons/script.xbmcbackup/resources/lib/vfs.py", line 104, in listdir
                                                if jsonobject['result']['files']:
                                            KeyError: 'result'



RE: [Release] XBMC Backup - robweber - 2012-07-25

It looks like the problem is that the XBMC JSONRPC command that should get the file contents cannot find the specified file. Can you turn on debugging and repost the log (note: turn on xbmc debugging and also turn on debug logging in the addon).

That file actually exists right?


Re: [Release] XBMC Backup - Martijn - 2012-07-25

to fix getting script fail:

if jsonobject.has_key('result') and jsonobject['result']['files']:



RE: [Release] XBMC Backup - robweber - 2012-07-26

(2012-07-25, 16:30)Martijn Wrote: to fix getting script fail:

if jsonobject.has_key('result') and jsonobject['result']['files']:

Thanks! I'll add this to the source and do another pull. The whole vfs class is frustrating me lately but I can't think of another cross platform way to list the files. The built in xbmcvfs library doesn't have support for directory listing.


RE: [Release] XBMC Backup - mikebzh44 - 2012-07-27

Maybe the next version will handle ZIP files but here is the log with XBMC and addon set to debug mode :

Code:
13:36:48 T:2897177408   DEBUG: JSONRPC: Incoming request: { "jsonrpc" : "2.0" , "method" : "Files.GetDirectory" , "params" : { "directory" : "zip:///storage/.xbmc/addons/web.browser.opera/opera12/share/opera/locale/en/en.zip/" , "sort" : { "method" : "file" } } , "id" : 1 }
13:36:48 T:2897177408   DEBUG: JSONRPC: Calling files.getdirectory
13:36:48 T:2897177408   DEBUG: GetZipList - Processing zip:///storage/.xbmc/addons/web.browser.opera/opera12/share/opera/locale/en/en.zip/
13:36:48 T:2897177408   DEBUG: CZipManager::GetZipList: failed to stat file zip:///storage/.xbmc/addons/web.browser.opera/opera12/share/opera/locale/en/en.zip/
13:36:48 T:2897177408   ERROR: GetDirectory - Error getting zip:///storage/.xbmc/addons/web.browser.opera/opera12/share/opera/locale/en/en.zip/
13:36:48 T:2897177408    INFO: -->Python script returned the following error<--
13:36:48 T:2897177408   ERROR: Error Type: <type 'exceptions.KeyError'>
13:36:48 T:2897177408   ERROR: Error Contents: 'result'
13:36:48 T:2897177408   ERROR: Traceback (most recent call last):
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 199, in <module>
                                                backup.run()
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 123, in run
                                                self.syncFiles()
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 137, in syncFiles
                                                self.fileManager.createFileList(self.Addon)
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 28, in createFileList
                                                self.walkTree(self.walk_path + "addons/")
                                              File "/storage/.xbmc/addons/script.xbmcbackup/default.py", line 62, in walkTree
                                                for (path, dirs, files) in vfs.walk(directory):
                                              File "/storage/.xbmc/addons/script.xbmcbackup/resources/lib/vfs.py", line 52, in walk
                                                for x in listdir(current_path, extra_metadata=True):
                                              File "/storage/.xbmc/addons/script.xbmcbackup/resources/lib/vfs.py", line 104, in listdir
                                                if jsonobject['result']['files']:
                                            KeyError: 'result'



Re: [Release] XBMC Backup - robweber - 2012-07-27

Hit up this thread again after the next update. Hopefully this will go away. The issue is that xbmc tries to go into zip files like a directory and this addon wants to treat them as a file. Hopefully the repo will update over the weekend.


RE: [Release] XBMC Backup - Jean-Max - 2012-07-29

Hello,

I am very interested by this very useful add-on

I tested last version 0.1.0 today :

XBMC Windows Eden 12Alpha4 (Sony Vaio Laptop, W7):
-> Script xbmc.backup failed

OPENELEC 1.95.5 Ion 64 (ZBOX HD-ID11)
-> Script xbmc.backup failed

Very interested by having this problem solved in next release

Thanks for the good idea
... and for the remaining work ! Wink


RE: [Release] XBMC Backup - bspaulding - 2012-07-29

Have been trying to get XBMC Backup to work with my ATV2, choosing my NAS as the destination over AFP. I keep getting the following error:

Error: Remote path cannot be empty

I definitely have got it filled out in the configuration. Any ideas?
actually, forget my last post. i was successful going the SMB:// route.

thanks for the great addon!


RE: [Release] XBMC Backup - mikebzh44 - 2012-07-30

With 0.1.1, ZIP files are ignored and addon don't crash.

Good job


RE: [Release] XBMC Backup - mikebzh44 - 2012-07-30

Here is the french translation for your addon :

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<strings>
    <string id="30010">Sauvegarde XBMC</string>
    <string id="30011">Général</string>
    <string id="30012">Sélection des fichiers</string>
    
    <string id="30020">Parcourir le chemin de sauvegarde</string>
    <string id="30021">Nom du répertoire de sauvegarde</string>
    <string id="30022">Mode silencieux</string>
    <string id="30023">Mode</string>
    <string id="30024">Saisir le chemin de sauvegarde</string>
    <string id="30025">Mode de saisie du chemin</string>
    <string id="30026">Log bavard</string>
    
    <string id="30030">Addons de l'utilisaeur</string>
    <string id="30031">Données des addons</string>
    <string id="30032">Bases de données</string>
    <string id="30033">Playlists</string>
    <string id="30034">Miniatures / Fanart</string>
    <string id="30035">Fichiers de configuration</string>
</strings>

There is still some strings in english as it's hard coded in settings.xml :

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
    <category id="general" label="30011">
        <setting id="addon_mode" type="enum" values="Backup|Restore" default="Backup" label="30023" />
        <setting id="remote_selection" type="enum" values="Browse Path|Type Path" defaults="Browse Path" label="30025"/>

Is there a way to translate them ? I have try with values="30027 | 30028" but with no success Sad


RE: [Release] XBMC Backup - Martijn - 2012-07-30

(2012-07-30, 10:02)mikebzh44 Wrote:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
    <category id="general" label="30011">
        <setting id="addon_mode" type="enum" values="Backup|Restore" default="Backup" label="30023" />
        <setting id="remote_selection" type="enum" values="Browse Path|Type Path" defaults="Browse Path" label="30025"/>

Is there a way to translate them ? I have try with values="30027 | 30028" but with no success Sad

Needs to be

Code:
type="labelenum" values="30027|30028"
IIRC and maybe some small code change to match it to the set value (haven't looked at the code)


RE: [Release] XBMC Backup - mikebzh44 - 2012-07-30

I have try to use your addon to ducplicate my XBMC setup to a fresh one so I did :

- backup everything with the addon
- rename XBMC folder to XBMC_old
- restart xbmc to build a fresh xbmc folder
- restore files xith the addon

My issues :

- guisettings.xml is not copied or is overwritten by default guisettings.xml when exiting XBMC. So I have to copy it when XBMC is closed.
- thumbnails are not restored. Subdirectories are created but files are not copied :
XBMC\userdata\Thumbnails\0 is empty
XBMC_old\userdata\Thumbnails\0 contains 38 Mb

My log file with verbose log mode on :

Code:
11:06:16 T:3036  NOTICE: Add File: -userdata
11:06:16 T:3036  NOTICE: Add File: -userdata/Thumbnails
11:06:16 T:3036   ERROR: XFILE::CDirectory::GetDirectory - Error getting C:\XBMC\xbmc_backup/userdata/Thumbnails
11:06:16 T:3036  NOTICE: script.xbmcbackup: Creating Files List
11:06:16 T:3036  NOTICE: script.xbmcbackup: Writing files to: C:\Documents and Settings\mibertho\Application Data\XBMC\

As I'm running on Windows XP, I think there is a problem is \ and /, maybe you shouls use path.join or something like that.


RE: [Release] XBMC Backup - robweber - 2012-07-30

@mikebzh44

Great work on the French translation. I'll try Martijn's suggestion for removing the hardcoded values from the settings.xml file so everything can be in the strings files. If you could translate those strings and post back I'll get everything committed.

Regarding the error you're seeing. I've used this on WinXP and Win7 systems and never had a paths problem before (the XBMC internal file system methods must correct the slashes). I'll try running the addon as you've described and see if I can reproduce the error. Also, the guisettings.xml file. This is kind of a hit/miss thing. That particular file is read/written to by XBMC while it is running. It could be that a file lock prevents it from being moved, I've had mixed success with this. From many of the forum posts I've seen it sounds like it is best to leave this file alone for the most part.


RE: [Release] XBMC Backup - mikebzh44 - 2012-07-30

For French translation :

Backup|Restore = Sauvegarde|Restauration
Browse Path|Type Path = Parcourir|Saisir

For issue when restoring thumbnails, I will try on my HTPC under OpenELEC and on my laptop under Windows 7 this evening.