pull/310/head
midoks 2 years ago
parent a8a9e9033e
commit 300bdc1eb1
  1. 3
      class/core/crontab_api.py
  2. 13
      plugins/backup_ftp/index.py

@ -377,8 +377,7 @@ class crontab_api:
stype = request.form.get('type', '')
bak_data = []
if stype == 'sites' or stype == 'database' or stype.find('database_') > -1 or stype == 'path':
if stype == 'sites' or stype == 'database' or stype.find('database_') > -1 or stype == 'path' or stype == 'logs':
hookPath = mw.getPanelDataDir() + "/hook_backup.json"
if os.path.exists(hookPath):
t = mw.readFile(hookPath)

@ -196,20 +196,23 @@ def backupAllFunc(stype):
os.system(cmd)
# 开始执行上传信息
if stype == 'database':
db_prefix = prefix_dict[stype]
bk_prefix = prefix_dict[stype]
else:
plugin_name = stype.replace('database_', '')
db_prefix = plugin_name + '/db'
bk_prefix = plugin_name + '/db'
bk_name = stype
if stype.find('database_') > -1:
bk_name = 'database'
find_path = mw.getBackupDir() + '/database/' + db_prefix + '_' + name
find_path = mw.getBackupDir() + '/' + bk_name + '/' + bk_prefix + '_' + name
find_new_file = "ls " + find_path + \
"_* | grep '.gz' | cut -d \ -f 1 | awk 'END {print}'"
filename = mw.execShell(find_new_file)[0].strip()
if filename == "":
print("not find upload file!")
mw.echoInfo("not find upload file!")
return False
ftp = FtpPSClient()

Loading…
Cancel
Save