日志
使用find命令定期删除n天前的日志文件
日志和备份多了,硬盘不够了,所以删除之
bear@njava:/data/log$ find /data/log -mtime +3 -exec rm -rf {} \;
关于find参数-mtime,-ctime,-atime
bear@njava:~$ man find -mtime n File's data was last modified n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file modification times. -ctime n File's status was last changed n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file status change times. -atime n File was last accessed n*24 hours ago. When find figures out how many 24-hour periods ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago.
标签云
.htaccess 301 2010 Android apache cache cacti CSS date ddos discuz django fastcgi freebsd git google http iftop linux macos mysql nginx njava php pr python sed seo snmp ssh ubuntu ubuntu10.04 wordpress xdebug 优化 密码 文件 时区 用户 登录 监控 缓存 网站 脚本 颜色
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
近期文章
近期评论
归档
链接表
QR Code
