#0 * * * * /bin/test.sh
下面是test.sh的内容
#!/bin/bash
#24小时里面需要排除的小时
exclude_hour=(18 19 20 21 22 23)
#current_hour=$(date +%H)
#测试脚本,直接给当前小时赋值
#current_hour=18
echo $current_hour
[[ ${exclude_hour[@]/${current_hour}/} != ${exclude_hour[@]} ]] && echo "Yes" || echo "No"