clear_dbbackup bug

This commit is contained in:
caoqianming 2022-11-11 14:30:14 +08:00
parent 03323fec17
commit 839e11b575
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ def clear_dbbackup(num: int=7):
from apps.monitor.views import get_file_list from apps.monitor.views import get_file_list
backpath = settings.BACKUP_PATH + '/database' backpath = settings.BACKUP_PATH + '/database'
files = get_file_list(backpath) files = get_file_list(backpath)
files_remove_list = files[6:] files_remove_list = files[num:]
for f in files_remove_list: for f in files_remove_list:
filepath = os.path.join(backpath, f) filepath = os.path.join(backpath, f)
os.remove(filepath) os.remove(filepath)