机器正有人用着,大概1点以后用完自己才能跑,所以定个时大概1点以后运行一下看看显卡有没有空能不能跑。
不能跑的话一个小时后再试试。
定时间启动.sh
#!/bin/bash
# 2024年3月14日1点0分0秒 阈值时间
date="20240314-223000"
while true
do
now="$(date "+%Y%m%d-%H%M%S")"
echo '当前时间:' $now
if [[ $date > $now ]]; then
echo "$date > $now"
elif [[ $date -eq $now ]]; then
echo "$date == $now"
else
echo "$date < $now"
# 执行GPU监控脚本
python demo.py
break
fi
sleep 3600
# 睡眠1h
done