« 山西的宽带运营商太过分了 私自窜改dns解析 | Main | [php] realip judge 前面补0的ip格式剔除 »
December 14, 2007
rm -rf * 系统管理员要排查的定时炸弹
|
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。 http://windtear.net/archives/2007/12/14/001298.html 很简单的一件事 系统管理员需要注意的就是查一下 /etc/crontab 这里的 PWD 环境变量是 / 这里面如果写的容错性判断不完善的话 所谓容错性判断 比较好的是用 find 千万不要用 万一谁不小心把 /path 删了 |
Posted by windtear at December 14, 2007 4:34 PM
Trackback Pings
TrackBack URL for this entry:
http://cgi.windtear.net/cgi-bin/wt-tb.cgi/1298
Comments
find /foo bar -exec rm {} \;
这样的方式有何不同呢?
ps:你的mt没有打开typekey的支持
Posted by: goergexsh at December 29, 2007 2:48 AM
typekey 打开了
xargs 更好 呵呵
如果文件太多的话 exec 方式就不行了
Posted by: windtear
at December 30, 2007 5:26 PM
晕,太多是多少呢?我一直用这个方式的说,删十万级别是可以的
-exec也是逐个解释过去的吧?
Posted by: George
at January 3, 2008 1:48 AM
-exec 有两种情况
一种是一次传过去执行 这种文件量很大不行
一种是逐个传过去执行 这种方式每次会起一个进程 不够完美
Posted by: windtear at January 3, 2008 2:12 PM
受教了,谢谢windtear
manpage 里讲
-exec command {} +
"The command line is built in much the same way that xargs builds its
command lines. Only one instance of ’{}’ is allowed within the command. The command is executed in the starting directory."
Posted by: George
at January 4, 2008 12:42 AM
Post a comment
【我爱网络】
2007-12-31 23:51 2007年度 ipcn.org/ipchina.org 总结报告
2007-12-31 00:31 vmware gsx server service
2007-12-31 00:15 squid 对 404 302 缓存的相关问题
2007-12-30 14:24 升级到 MovableType 3.3x 并修改 entry_basename 兼容性
2007-12-30 13:52 [php] realip judge 前面补0的ip格式剔除
2007-12-14 16:34 rm -rf * 系统管理员要排查的定时炸弹
2007-12-13 19:03 山西的宽带运营商太过分了 私自窜改dns解析
2007-12-13 16:35 F5 MIB 再学习 唯一性标记用地址的小bug
2007-12-11 22:15 perl 用Spreadsheet::WriteExcel写了个处理/读写excel的小程序
2007-12-11 13:39 perl 变量转义的问题