перед созданием бэкапа старую папку удаляем
This commit is contained in:
parent
7c7f786a76
commit
ad05a6980f
|
|
@ -8,11 +8,14 @@ class CreateBackupCommand(BaseBackupCommand):
|
|||
BaseBackupCommand.__init__(self)
|
||||
|
||||
def execute(self):
|
||||
if os.path.exists(self.backupDirAbsPath):
|
||||
raise Exception('folder: {0} already exists'.format(self.backupDirAbsPath))
|
||||
#if os.path.exists(self.backupDirAbsPath):
|
||||
# raise Exception('folder: {0} already exists'.format(self.backupDirAbsPath))
|
||||
|
||||
dirContent = os.listdir(self.srcAbsDirPath)
|
||||
|
||||
if os.path.exists(self.backupDirAbsPath):
|
||||
shutil.rmtree(self.backupDirAbsPath)
|
||||
|
||||
os.mkdir(self.backupDirAbsPath)
|
||||
|
||||
for fileOrDir in dirContent:
|
||||
|
|
|
|||
Loading…
Reference in New Issue