Changed backup script to get password from defs
This commit is contained in:
parent
56aad3c6e6
commit
1397a37855
1 changed files with 14 additions and 1 deletions
|
|
@ -123,7 +123,7 @@ def get_backup():
|
|||
"""
|
||||
#if verbose: print webnotes.conn.cur_db_name + " " + webnotes.defs.db_password
|
||||
odb = BackupGenerator(webnotes.conn.cur_db_name, webnotes.conn.cur_db_name,\
|
||||
webnotes.defs.db_password)
|
||||
get_db_password(webnotes.conn.cur_db_name))
|
||||
recipient_list = odb.get_backup()
|
||||
delete_temp_backups()
|
||||
webnotes.msgprint("""A download link to your backup will be emailed \
|
||||
|
|
@ -131,6 +131,19 @@ def get_backup():
|
|||
%s""" % (', '.join(recipient_list)))
|
||||
|
||||
|
||||
def get_db_password(db_name):
|
||||
"""
|
||||
Get db password from defs
|
||||
"""
|
||||
from webnotes import defs
|
||||
if hasattr(defs, 'get_db_password'):
|
||||
return defs.get_db_password(db_name)
|
||||
|
||||
if hasattr(defs, 'db_password'):
|
||||
return defs.db_password
|
||||
|
||||
|
||||
|
||||
def delete_temp_backups():
|
||||
"""
|
||||
Cleans up the backup_link_path directory by deleting files older than 24 hours
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue