'full_location' -> 'location' in database_backup.py
This commit is contained in:
parent
5674dc4a82
commit
0fb947dc5a
1 changed files with 4 additions and 4 deletions
|
@ -16,15 +16,15 @@ class Module(object):
|
||||||
|
|
||||||
@Utils.hook("timer.database-backup")
|
@Utils.hook("timer.database-backup")
|
||||||
def backup(self, event):
|
def backup(self, event):
|
||||||
full_location = self.bot.database.full_location
|
location = self.bot.database.location
|
||||||
files = glob.glob("%s.*" % full_location)
|
files = glob.glob("%s.*" % ocation)
|
||||||
files = sorted(files)
|
files = sorted(files)
|
||||||
|
|
||||||
if len(files) == 5:
|
if len(files) == 5:
|
||||||
os.remove(files[0])
|
os.remove(files[0])
|
||||||
|
|
||||||
suffix = datetime.datetime.now().strftime("%y-%m-%d.%H:%M:%S")
|
suffix = datetime.datetime.now().strftime("%y-%m-%d.%H:%M:%S")
|
||||||
backup_file = "%s.%s" % (full_location, suffix)
|
backup_file = "%s.%s" % (location, suffix)
|
||||||
shutil.copy2(full_location, backup_file)
|
shutil.copy2(location, backup_file)
|
||||||
|
|
||||||
event["timer"].redo()
|
event["timer"].redo()
|
||||||
|
|
Loading…
Add table
Reference in a new issue