草庐IT

logrotate command in Linux

背景在生产过程中,由于磁盘空间、保留周期等因素,会对系统、应用等日志提出要求,要求系统日志定期进行轮转、压缩和删除,从而减少开销,而系统自带的logrotate 则是一个简单又实用的小工具,下面着重介绍一下,满足日常需求。语法Usage:logrotate[OPTION...]  常用参数:-f非设定周期内强制运行-d调试,对日志模拟进行操作-v可视化执行过程结果其它参数不常用,详情见下:[root@test01~]#logrotate--helpUsage:logrotate[OPTION...]-d,--debugDon'tdoanything,justtest(implies-v)-f,

Nginx--logrotate日志切割打包

1.系统是默认安装的,查看系统是否安装logrotatecentosrpm-qllogrotate/etc/cron.daily/logrotate/etc/logrotate.conf/etc/logrotate.d/etc/rwtab.d/logrotate/usr/sbin/logrotate/usr/share/doc/logrotate-3.8.6/usr/share/doc/logrotate-3.8.6/CHANGES/usr/share/doc/logrotate-3.8.6/COPYING/usr/share/man/man5/logrotate.conf.5.gz/usr/

Nginx--logrotate日志切割打包

1.系统是默认安装的,查看系统是否安装logrotatecentosrpm-qllogrotate/etc/cron.daily/logrotate/etc/logrotate.conf/etc/logrotate.d/etc/rwtab.d/logrotate/usr/sbin/logrotate/usr/share/doc/logrotate-3.8.6/usr/share/doc/logrotate-3.8.6/CHANGES/usr/share/doc/logrotate-3.8.6/COPYING/usr/share/man/man5/logrotate.conf.5.gz/usr/