浏览代码

[minor] change backup filename format to DDMMYY_HHMMSS_SITE_DATABASE.*

version-14
mbauskar 7 年前
父节点
当前提交
bcc861ad28
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. +5
    -4
      frappe/utils/backups.py

+ 5
- 4
frappe/utils/backups.py 查看文件

@@ -61,12 +61,13 @@ class BackupGenerator:
import random import random


todays_date = now_datetime().strftime('%Y%m%d_%H%M%S') todays_date = now_datetime().strftime('%Y%m%d_%H%M%S')
random_string = frappe.generate_hash(length=8)
site = frappe.local.site or frappe.generate_hash(length=8)
site = site.replace('.', '_')


#Generate a random name using today's date and a 8 digit random number #Generate a random name using today's date and a 8 digit random number
for_db = todays_date + "_" + random_string + "_database.sql.gz"
for_public_files = todays_date + "_" + random_string + "_files.tar"
for_private_files = todays_date + "_" + random_string + "_private_files.tar"
for_db = todays_date + "_" + site + "_database.sql.gz"
for_public_files = todays_date + "_" + site + "_files.tar"
for_private_files = todays_date + "_" + site + "_private_files.tar"
backup_path = get_backup_path() backup_path = get_backup_path()


if not self.backup_path_db: if not self.backup_path_db:


正在加载...
取消
保存