minor: update start.bash

This commit is contained in:
hinak0 2022-09-25 23:04:27 +08:00
parent 21113369b3
commit 65f2f640ad

View File

@ -1,6 +1,14 @@
#!/bin/bash
# 输出日志路径
stdout_path=$(cd `dirname $0`;pwd)/stdout.log
# 1-1200秒随机延时
# 随机值$RANDOM值为1~32767
delay=$[$RANDOM%1200];
# 进入脚本所在目录
cd $(cd `dirname $0`;pwd)
# 随机延时$RANDOM值为1~32767
sleep $[$RANDOM%1200];
python ./main.py;
echo "$(date) $[$delay/60]分钟后开始执行" > $stdout_path;
sleep $delay;
python3 main.py >> $stdout_path;