试了很久,最终的解决方法如下:
1,编写sh脚本:rm_wk.sh
#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH kill -9 $(ps -ef | grep kdevtmpfsi| grep -v grep | awk '{print $2}') kill -9 $(ps -ef | grep kinsing| grep -v grep | awk '{print $2}') rm -rf /tmp/kdevtmpfsi rm -rf /var/tmp/kinsing echo "----------------------------------------------------------------------------" endDate=`date +"%Y-%m-%d %H:%M:%S"` echo "★[$endDate] Successful" echo "----------------------------------------------------------------------------"
2. # sh rm_wk.sh 测试一下
3. 建立crontab ,一分钟执行一次:
# crontab -e
*/1 * * * * nohup bash -x /vegas/rm_wk.sh
4. top 试试
相关文章
暂无评论...