From 08c4b0845d941fe28e9fa54c9dfa3430c760d5d6 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 26 Oct 2022 11:34:52 +0800 Subject: [PATCH] Update crontab_api.py --- class/core/crontab_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/class/core/crontab_api.py b/class/core/crontab_api.py index 326b8f259..23bab0399 100755 --- a/class/core/crontab_api.py +++ b/class/core/crontab_api.py @@ -409,6 +409,15 @@ class crontab_api: shell = param.sFile else: head = "#!/bin/bash\nPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin\nexport PATH\n" + + source_bin_activate = ''' +MW_PATH=%s/bin/activate +if [ -f $MW_PATH ];then + source $MW_PATH +fi + ''' % (mw.getRunDir(),) + + head = head + source_bin_activate + "\n" log = '.log' script_dir = mw.getServerDir() + "/mdserver-web/scripts"