根据关键词注释掉crontab中定时任务,取消任务的自动触发执行
crontab -l >/home/t.txt && sed -i '/Cassandra.sh/{s/^/#/g}' /home/t.txt && crontab /home/t.txt
避免以#开头的注释行累加,清除注释行
crontab -l >/home/t.txt && sed -i -e '/Cassandra.sh/d' -e '/^#/d' /home/t.txt && crontab /home/t.txt[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23937368/viewspace-1056921/
,如需转载,请注明出处,否则将追究法律责任。