sed根据关键字注释crontab的计划任务

Posted on 2015-09-21 09:13  NooBkey  阅读(569)  评论(0)    收藏  举报

[root@linux06 ~]# crontab -e
*/5 * * * * /root/time_test.sh

 

------------------------------------------------

sed  -i '/time_test/s/^/#/g'  /var/spool/cron/root 

 

-----------------------------------------------

[root@linux06 ~]# crontab -l
#*/5 * * * * /root/time_test.sh

 

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3