shell脚本
#!/bin/bash
cd /wx/ai-alarm-fourcars-lwl/src/
python3 lwl_server.py > lwl.log 2>&1 &
查看后台进程命令
ps -ef | grep lwl
定时任务相关代码
from apscheduler.schedulers.blocking import BlockingScheduler
if __name__ == '__main__':
# timed task
scheduler = BlockingScheduler()
scheduler.add_job(gen_alarm, 'cron', hour='00-01', minute='01', args=[])
scheduler.start()