From 0a98b4dc09974926e5248dcd189350ad634ed849 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 17 Dec 2022 15:45:04 +0800 Subject: [PATCH] Update crontab_api.py --- class/core/crontab_api.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/class/core/crontab_api.py b/class/core/crontab_api.py index 5b1fd19f0..8241eba5a 100755 --- a/class/core/crontab_api.py +++ b/class/core/crontab_api.py @@ -504,13 +504,17 @@ export LANG=en_US.UTF-8 MW_PATH=%s/bin/activate if [ -f $MW_PATH ];then source $MW_PATH -fi - ''' % (mw.getRunDir(),) +fi''' % (mw.getRunDir(),) head = head + source_bin_activate + "\n" log = '.log' - script_dir = mw.getServerDir() + "/mdserver-web/scripts" + script_dir = mw.getRunDir() + "/scripts" + if stype.find('database_') > -1: + plugin_name = stype.replace('database_', '') + script_dir = mw.getRunDir() + "/plugins/" + plugin_name + "/scripts" + stype = 'database' + script_dir = '' wheres = { 'path': head + "python3 " + script_dir + "/backup.py path " + param['sname'] + " " + str(param['save']),