标签:code man echo str res nbsp lua 维护 gre
1.
每周一,三,五的下午3:00系统进入维护状态,重新启动系统。
00 15 * *1,3,5 shutdown -r +5
2.
~/tmp/restart.sh:
date
cd /var/testpid=`ps -e|grep test | grep -v grep | awk ‘{print $1‘}`kill -15 $pidsleep 2./test ./test.lua echo "restart end, return $?, `date`"让crontab来调用
crontab -e
* 3 1 * * sh ~/tmp/restart.sh
每周一,三,五的下午3:00系统进入维护状态,重新启动系统。
00 15 * *1,3,5 shutdown -r +5
定时任务含义:
每天的下午4点、5点、6点的5 min、15 min、25 min、35 min、45 min、55 min时执行命令。
5,15,25,35,45,55 16,17,18 * * * command
每周一,三,五的下午3:00系统进入维护状态,重新启动系统。
00 15 * *1,3,5 shutdown -r +5
1日早上4点
0 4 1 1 * command line
每小时(第一分钟)执行/etc/cron.hourly内的脚本
01 * * * * root run-parts /etc/cron.hourly
标签:code man echo str res nbsp lua 维护 gre
原文地址:https://www.cnblogs.com/stillstep/p/11068364.html