Browse Source

[minor] change backup filename format to DDMMYY_HHMMSS_SITE_DATABASE.*

version-14
mbauskar 7 years ago
parent
commit
bcc861ad28
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      frappe/utils/backups.py

+ 5
- 4
frappe/utils/backups.py View File

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

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
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()

if not self.backup_path_db:


Loading…
Cancel
Save