Przeglądaj źródła

Delete backups if path exists

version-14
Nabin Hait 7 lat temu
rodzic
commit
44277a35fb
1 zmienionych plików z 7 dodań i 5 usunięć
  1. +7
    -5
      frappe/utils/backups.py

+ 7
- 5
frappe/utils/backups.py Wyświetl plik

@@ -179,11 +179,13 @@ def delete_temp_backups(older_than=24):
""" """
Cleans up the backup_link_path directory by deleting files older than 24 hours Cleans up the backup_link_path directory by deleting files older than 24 hours
""" """
file_list = os.listdir(get_backup_path())
for this_file in file_list:
this_file_path = os.path.join(get_backup_path(), this_file)
if is_file_old(this_file_path, older_than):
os.remove(this_file_path)
backup_path = get_backup_path()
if os.path.exists(backup_path):
file_list = os.listdir(get_backup_path())
for this_file in file_list:
this_file_path = os.path.join(get_backup_path(), this_file)
if is_file_old(this_file_path, older_than):
os.remove(this_file_path)


def is_file_old(db_file_name, older_than=24): def is_file_old(db_file_name, older_than=24):
""" """


Ładowanie…
Anuluj
Zapisz