mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
系统日志增加时间筛选和清空
This commit is contained in:
@@ -46,11 +46,11 @@ def run():
|
||||
if task_before:
|
||||
escape_task_before = task_before.replace('"', '\\"').replace("$", "\\$")
|
||||
command += f" && eval '{escape_task_before}'"
|
||||
print("执行前置命令\n")
|
||||
|
||||
python_command = "PYTHONPATH= python3 -c 'import os, json; print(json.dumps(dict(os.environ)))'"
|
||||
command += f" && echo -e '{split_str}' && {python_command}\""
|
||||
|
||||
print("执行前置命令\n")
|
||||
res = subprocess.check_output(command, shell=True, encoding="utf-8")
|
||||
output, env_str = res.split(split_str)
|
||||
|
||||
@@ -60,7 +60,8 @@ def run():
|
||||
os.environ[key] = value
|
||||
|
||||
print(output)
|
||||
print("执行前置命令结束")
|
||||
if task_before:
|
||||
print("执行前置命令结束")
|
||||
|
||||
except subprocess.CalledProcessError as error:
|
||||
print(f"run task before error: {error}")
|
||||
|
||||
Reference in New Issue
Block a user