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

Posted on 2015-09-21 09:13  NooBkey  阅读(554)  评论(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

 

Copyright © 2024 NooBkey
Powered by .NET 8.0 on Kubernetes