feat: Allow skip tables during backups
This commit is contained in:
parent
9e88b7c28d
commit
2bbe464f59
1 changed files with 5 additions and 1 deletions
|
|
@ -148,7 +148,11 @@ class BackupGenerator:
|
|||
args = dict([item[0], frappe.utils.esc(str(item[1]), '$ ')]
|
||||
for item in self.__dict__.copy().items())
|
||||
|
||||
cmd_string = """mysqldump --single-transaction --quick --lock-tables=false -u %(user)s -p%(password)s %(db_name)s -h %(db_host)s -P %(db_port)s | gzip > %(backup_path_db)s """ % args
|
||||
if self.verbose:
|
||||
print("Skipping Tables: {0}\n".format(", ".join(frappe.conf.ignore_tables_in_backup)))
|
||||
|
||||
args["skip_tables"] = " ".join(["--ignore-table={0}.{1}".format(frappe.conf.db_name, table) for table in frappe.conf.ignore_tables_in_backup])
|
||||
cmd_string = """mysqldump --single-transaction --quick --lock-tables=false -u %(user)s -p%(password)s %(db_name)s -h %(db_host)s -P %(db_port)s %(skip_tables)s | gzip > %(backup_path_db)s """ % args
|
||||
|
||||
if self.db_type == 'postgres':
|
||||
cmd_string = "pg_dump postgres://{user}:{password}@{db_host}:{db_port}/{db_name} | gzip > {backup_path_db}".format(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue