diff options
| author | 2018-09-24 15:26:31 +0100 | |
|---|---|---|
| committer | 2018-09-24 15:26:31 +0100 | |
| commit | bb641b08709c3e6177729121010bc02692600360 (patch) | |
| tree | 9ddee03d0b9f4aa222f222b104f0a1fec9259356 /modules | |
| parent | Move most code in root directory to src/ (diff) | |
| signature | ||
Move log and database files to their own folders
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/database_backup.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/database_backup.py b/modules/database_backup.py index eeddbdf2..f842fa70 100644 --- a/modules/database_backup.py +++ b/modules/database_backup.py @@ -15,14 +15,15 @@ class Module(object): next_due=time.time()+until_next_hour) def backup(self, event): - files = glob.glob("%s.*" % self.bot.args.database) + full_location = self.bot.database.full_location + files = glob.glob("%s.*" % full_location) files = sorted(files) if len(files) == 5: os.remove(files[0]) suffix = datetime.datetime.now().strftime("%y-%m-%d.%H:%M:%S") - backup_file = "%s.%s" % (self.bot.args.database, suffix) - shutil.copy2(self.bot.args.database, backup_file) + backup_file = "%s.%s" % (full_location, suffix) + shutil.copy2(fulllocation, backup_file) event["timer"].redo() |
