Linux 查找nginx access_log 并删除一个月之前的log

来源:互联网 发布:surface pro知乎 编辑:程序博客网 时间:2024/06/01 07:33

find ./ -mtime +10 -name "access.log-*" -exec rm -rf {} \;


解释:保留10天内的access.log,其余的全部删除

mtime 是文件的更新时间

0 0
原创粉丝点击