Update crontab_api.py

pull/310/head
midoks 2 years ago
parent e492a87160
commit b31297b47f
  1. 18
      class/core/crontab_api.py

@ -510,9 +510,12 @@ fi''' % (mw.getRunDir(),)
log = '.log' log = '.log'
script_dir = mw.getRunDir() + "/scripts" script_dir = mw.getRunDir() + "/scripts"
source_stype = 'database'
if stype.find('database_') > -1: if stype.find('database_') > -1:
plugin_name = stype.replace('database_', '') plugin_name = stype.replace('database_', '')
script_dir = mw.getRunDir() + "/plugins/" + plugin_name + "/scripts" script_dir = mw.getRunDir() + "/plugins/" + plugin_name + "/scripts"
source_stype = stype
stype = 'database' stype = 'database'
wheres = { wheres = {
@ -525,13 +528,14 @@ fi''' % (mw.getRunDir(),)
if param['backup_to'] != 'localhost': if param['backup_to'] != 'localhost':
cfile = mw.getPluginDir() + "/" + \ cfile = mw.getPluginDir() + "/" + \
param['backup_to'] + "/index.py" param['backup_to'] + "/index.py"
wheres = {
'path': head + "python3 " + cfile + " path " + param['sname'] + " " + str(param['save']), wheres['path'] = head + "python3 " + cfile + \
'site': head + "python3 " + cfile + " site " + param['sname'] + " " + str(param['save']), " path " + param['sname'] + " " + str(param['save'])
'database': head + "python3 " + cfile + " " + stype + " " + param['sname'] + " " + str(param['save']), wheres['site'] = head + "python3 " + cfile + \
'logs': head + "python3 " + script_dir + "/logs_backup.py " + param['sname'] + log + " " + str(param['save']), " site " + param['sname'] + " " + str(param['save'])
'rememory': head + "/bin/bash " + script_dir + '/rememory.sh' wheres['database'] = head + "python3 " + cfile + " " + \
} source_stype + " " + \
param['sname'] + " " + str(param['save'])
try: try:
shell = wheres[stype] shell = wheres[stype]
except: except:

Loading…
Cancel
Save