Merge pull request #295 from hinak0/master

minor: update start.bash
This commit is contained in:
Womsxd 2022-10-21 10:37:35 +08:00 committed by GitHub
commit 2e418bece9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;