CentOS系统计划任务最小只能设置到分级,要设置成秒级只需要在分级的计划任务里设置个循环执行命令就行了
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
step=5
for (( i = 0; i < 60; i=(i+step) )); do
curl -sS --connect-timeout 10 -m 60 'http://www.baidu.com/'
echo "----------------------------------------------------------------------------"
endDate=`date +"%Y-%m-%d %H:%M:%S"`
echo "★[$endDate] Successful"
echo "----------------------------------------------------------------------------"
sleep $step
done
exit 0
原创文章,作者:admin,如若转载,请注明出处:https://ntib.cn/247.html