add .back suffix to database backups
This commit is contained in:
parent
fe16c0132f
commit
e58e9a2058
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
def _backup(self, timer):
|
||||
location = self.bot.database.location
|
||||
files = glob.glob("%s.*" % location)
|
||||
files = glob.glob("%s.*.back" % location)
|
||||
files = sorted(files)
|
||||
|
||||
while len(files) > 4:
|
||||
|
@ -23,7 +23,7 @@ class Module(ModuleManager.BaseModule):
|
|||
files.pop(-1)
|
||||
|
||||
suffix = datetime.datetime.now().strftime("%y-%m-%d.%H:%M:%S")
|
||||
backup_file = "%s.%s" % (location, suffix)
|
||||
backup_file = "%s.%s.back" % (location, suffix)
|
||||
shutil.copy2(location, backup_file)
|
||||
|
||||
timer.redo()
|
||||
|
|
Loading…
Reference in a new issue