mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-28 17:34:47 +00:00
[fix] [minor] backup dropbox fixed for backup and files path
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import os
|
import os
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import get_request_site_address, get_base_path, cstr
|
from webnotes.utils import get_request_site_address, cstr
|
||||||
from webnotes import _
|
from webnotes import _
|
||||||
|
|
||||||
from backup_manager import ignore_list
|
from backup_manager import ignore_list
|
||||||
@@ -75,6 +75,7 @@ def backup_to_dropbox():
|
|||||||
from dropbox import client, session
|
from dropbox import client, session
|
||||||
from conf import dropbox_access_key, dropbox_secret_key
|
from conf import dropbox_access_key, dropbox_secret_key
|
||||||
from webnotes.utils.backups import new_backup
|
from webnotes.utils.backups import new_backup
|
||||||
|
from webnotes.utils import get_files_path, get_backups_path
|
||||||
if not webnotes.conn:
|
if not webnotes.conn:
|
||||||
webnotes.connect()
|
webnotes.connect()
|
||||||
|
|
||||||
@@ -87,8 +88,7 @@ def backup_to_dropbox():
|
|||||||
|
|
||||||
# upload database
|
# upload database
|
||||||
backup = new_backup()
|
backup = new_backup()
|
||||||
filename = os.path.join(get_base_path(), "public", "backups",
|
filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db))
|
||||||
os.path.basename(backup.backup_path_db))
|
|
||||||
upload_file_to_dropbox(filename, "/database", dropbox_client)
|
upload_file_to_dropbox(filename, "/database", dropbox_client)
|
||||||
|
|
||||||
webnotes.conn.close()
|
webnotes.conn.close()
|
||||||
@@ -97,7 +97,7 @@ def backup_to_dropbox():
|
|||||||
# upload files to files folder
|
# upload files to files folder
|
||||||
did_not_upload = []
|
did_not_upload = []
|
||||||
error_log = []
|
error_log = []
|
||||||
path = os.path.join(get_base_path(), "public", "files")
|
path = get_files_path()
|
||||||
for filename in os.listdir(path):
|
for filename in os.listdir(path):
|
||||||
filename = cstr(filename)
|
filename = cstr(filename)
|
||||||
if filename in ignore_list:
|
if filename in ignore_list:
|
||||||
|
|||||||
Reference in New Issue
Block a user