Crontab 配置
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
Crontab 配置
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