From e58e9a205895d5a4de14677556a337a581dfeaa0 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 14 Oct 2019 18:13:43 +0100 Subject: [PATCH] add .back suffix to database backups --- modules/database_backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/database_backup.py b/modules/database_backup.py index 017db88a..cd9a01c9 100644 --- a/modules/database_backup.py +++ b/modules/database_backup.py @@ -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()