使用shell脚本实现Linux宝塔面板秒级计划任务
#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH step=1 注意:这里默认是1秒,可以改。 for (( i = 0; i<60; i=(i+step) )); do curl -sS --connect-timeout 10 -m 60 '你要执行的url' echo "-------------------------监控成功-----------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "-------------------------监控成功-----------------------------------" sleep $step done exit 0
标签:bin,宝塔,sbin,echo,step,秒级,usr,Linux From: https://www.cnblogs.com/logan47537/p/17109717.html