15 lines
795 B
Python
15 lines
795 B
Python
import json, subprocess
|
|
|
|
d = json.load(open('/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json'))
|
|
jobs = d if isinstance(d, list) else d.get('jobs', [])
|
|
targets = ['策略评估-每周', '建议对账-每周', '数据治理-每周',
|
|
'跨市场背离检测-周末', '自选股自动重评-周末', 'state.db真空整理-每周']
|
|
for j in jobs:
|
|
if j.get('name') in targets:
|
|
jid = j.get('id')
|
|
print(f"triggering: {j['name']} (id={jid})")
|
|
r = subprocess.run(['/home/hmo/hermes-agent/.venv/bin/python', '-m', 'hermes_cli.main',
|
|
'-p', 'position-analyst', 'cron', 'run', jid],
|
|
capture_output=True, text=True, timeout=30)
|
|
out = (r.stdout + r.stderr).strip()[:150]
|
|
print(f' -> {out}') |