From d69a1b2d27e5f6154ec385e50e2a4b59c6c69b1c Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Mon, 4 Aug 2014 19:58:56 -0500 Subject: [PATCH] delete old file, if it exists --- resources/lib/backup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 81e0d59..df97d8c 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -115,6 +115,10 @@ class XbmcBackup: progressBarTitle = utils.getString(30010) + " - " if(mode == self.Backup and self.remote_vfs.root_path != ''): if(utils.getSetting("compress_backups") == 'true'): + #delete old temp file + if(self.xbmc_vfs.exists(xbmc.translatePath('special://temp/xbmc_backup_temp.zip'))): + self.xbmc_vfs.rmfile(xbmc.translatePath('special://temp/xbmc_backup_temp.zip')) + #save the remote file system and use the zip vfs self.saved_remote_vfs = self.remote_vfs self.remote_vfs = ZipFileSystem(xbmc.translatePath("special://temp/xbmc_backup_temp.zip"),"w")