File size: 321 Bytes
9b03d07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import schedule
import time
import subprocess

def job():
    print("开始执行定时任务")
    subprocess.run(["/app/entrypoint.sh", "run_script"], shell=True)
    print("定时任务执行完成")

schedule.every(6).hours.do(job)

print("调度器已启动")
while True:
    schedule.run_pending()
    time.sleep(1)