1./app/logs/ 里面的日志只保留7天的(apache天天生成一个文件)

1./app/logs/ 里面的日志只保留7天的(apache天天生成一个文件) 

 [root@centos6 ~]# vi /server/scripts/del.shapache

里面加上centos

find /app/logs -type f -name "access*.log" -mtime +7 | xargs rm –f;app

或者加上spa

find /app/logs -type f -name "access*.log" -mtime +7 exec rm –f {} \;日志

[root@centos6 ~]# crontab –eserver

里面加上crontab

00 00 * * * /bin/sh /server/scripts/del.sh > /dev/null 2>&1ip

-mtime 是指修改时间  +7 是指7天以前的  -7 是指最近7天的im

-atime 是访问时间tab

-ctime 是改变时间

相关文章
相关标签/搜索