0 21 * * 6 /bin/sh /root/time.sh #“6”代表周六
时间判断脚本如下:
#!/bin/bash
if [ "$(date -d "+7 days" +%d)" -gt "$(date +%d)" ] #如果是每月第一周将"-gt"该为“-lt”
then
echo "False"
else
/bin/sh /root/server.sh
fi
0 21 * * 6 /bin/sh /root/time.sh #“6”代表周六
时间判断脚本如下:
#!/bin/bash
if [ "$(date -d "+7 days" +%d)" -gt "$(date +%d)" ] #如果是每月第一周将"-gt"该为“-lt”
then
echo "False"
else
/bin/sh /root/server.sh
fi
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。