From 525dd8ff869d6499a5c9fe0919cbf242407236ee Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 31 Jul 2014 15:20:22 -0500 Subject: [PATCH] delete temp zip file when done --- resources/lib/backup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 326471f..e66701e 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -216,9 +216,10 @@ class XbmcBackup: if(utils.getSetting("compress_backups") == 'true'): #send the zip file to the real remote vfs + zip_name = self.remote_vfs.root_path[:-1] + ".zip" self.remote_vfs.cleanup() - self.xbmc_vfs.rename(xbmc.translatePath(utils.data_dir() + "xbmc_backup_temp.zip"), xbmc.translatePath(utils.data_dir() + self.remote_vfs.root_path[:-1] + ".zip")) - fileManager.addFile(xbmc.translatePath(utils.data_dir() + self.remote_vfs.root_path[:-1] + ".zip")) + self.xbmc_vfs.rename(xbmc.translatePath(utils.data_dir() + "xbmc_backup_temp.zip"), xbmc.translatePath(utils.data_dir() + zip_name)) + fileManager.addFile(xbmc.translatePath(utils.data_dir() + zip_name)) #set root to data dir home self.xbmc_vfs.set_root(xbmc.translatePath(utils.data_dir())) @@ -226,6 +227,9 @@ class XbmcBackup: self.remote_vfs = self.saved_remote_vfs self.progressBar.updateProgress(0, "Copying Zip Archive") self.backupFiles(fileManager.getFiles(),self.xbmc_vfs, self.remote_vfs) + + #delete the temp zip file + self.xbmc_vfs.rmdir(xbmc.translatePath(utils.data_dir() + zip_name)) #remove old backups self._rotateBackups()