27 lines
784 B
Python
27 lines
784 B
Python
import subprocess
|
|
from datetime import datetime, timedelta
|
|
import time
|
|
while True:
|
|
# 获取当前时间的UTC时间
|
|
now = datetime.utcnow()
|
|
|
|
# 计算到下一个08:00的时间间隔
|
|
next_run = datetime(now.year, now.month, now.day, 8, 0)
|
|
if now >= next_run:
|
|
next_run += timedelta(days=1)
|
|
sleep_time = (next_run - now).total_seconds()
|
|
|
|
# 休眠直到下一个08:00
|
|
time.sleep(sleep_time)
|
|
|
|
# 运行 nochain_lyq_v2.py
|
|
command1 = f"python3 nochain_lyq_v2.py"
|
|
subprocess.run(command1, shell=True)
|
|
|
|
# 运行 nochain_update_lyq.py
|
|
command2 = f"python3 nochain_update_lyq.py"
|
|
subprocess.run(command2, shell=True)
|
|
|
|
# 运行 nochain_eth_lyq.py
|
|
command3 = f"python3 nochain_eth_lyq.py"
|
|
subprocess.run(command3, shell=True) |