logrotate 不生效
登录服务器查看,发现日志没有自动切割。去查看micros配置文件:
[root@ecs-11-151 ~]# cat /etc/logrotate.d/micros
/data/logs/*/*.log {
rotate 3
copytruncate
daily
dateext
compress
missingok
}
看着没什么问题,手动执行看看
[root@ecs-11-150 logrotate.d]# logrotate -vf micros
reading config file micros
Allocating hash table for state file, size 15360 B
Handling 1 logs
rotating pattern: /data/logs/*/*.log forced from command line (3 rotations)
empty log files are rotated, old logs are removed
considering log /data/logs/cloud/accumulationfund-service.log
error: skipping "/data/logs/cloud/accumulationfund-service.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /data/logs/cloud/bill-cloud.log
error: skipping "/data/logs/cloud/bill-cloud.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
大意是日志文件所在父目录有不安全的权限,需要在配置文件设置su项
去查看日志目录,发现为了方便开发看日志,目录都改为 777 权限了。
将配置文件改为如下:
[root@ecs-11-151 ~]# cat /etc/logrotate.d/micros
/data/logs/*/*.log {
rotate 3
su root root
copytruncate
daily
dateext
compress
missingok
}
手动执行下:
logrotate -vf micros
去看下日志文件有没有处理
[root@ecs-11-151 service]# ls
apiAuth-service.log
apiAuth-service.log-20190701.gz
app-provider.log
app-provider.log-20190701.gz
logrotate 不生效的更多相关文章
- Linux日志切割方法[Logrotate、python、shell实现方式]
Linux日志切割方法[Logrotate.python.shell实现方式] 对于Linux系统安全来说,日志文件是极其重要的工具.不知为何,我发现很多运维同学的服务器上都运行着一些诸如每天切分 ...
- logrotate机制与原理[转载]
http://blog.lightxue.com/how-logrotate-works/ 日志实在是太有用了,它记录了程序运行时各种信息.通过日志可以分析用户行为,记录运行轨迹,查找程序问题.可惜磁 ...
- logrotate关于日志轮询和分割
如果你的是源码包安装的服务,那么对于Linux服务器上的一些服务在运行当中产生的日志很重要,可以判断你的服务是否有异常等,但源码包安装的日志是没有日志的轮询或者说是切割能力的, 所以你就需要用到bas ...
- 如何在Centos 7上用Logrotate管理日志文件
何为Logrotate? Logrotate是一个实用的日志管理工具,旨在简化对系统上生成大量的日志文件进行管理. Logrotate允许自动旋转压缩,删除和邮寄日志文件,从而节省宝贵的磁盘空间. L ...
- rsyslog和logrotate
简介 rsyslog 是一个 syslogd 的多线程增强版. 现在Fedora和Ubuntu, rhel6默认的日志系统都是rsyslog了 rsyslog负责写入日志, logrotate负责备份 ...
- rsyslog和logrotate服务
参考: http://www.lampbo.org/others/opensource/rsyslog-config-file-detail.html http://bangerlee.blog.ch ...
- logrotate日志转储
1 工具目录 ***系统开启selinux,logrotate会不生效*** linux默认会安装logrotate工具,自身的boot.log就是通过它分割转储的. [root@webmaster ...
- 利用Linux自带的logrotate管理日志
日常运维中,经常要对各类日志进行管理,清理,监控,尤其是因为应用bug,在1小时内就能写几十个G日志,导致磁盘爆满,系统挂掉. nohup.out,access.log,catalina.out 本文 ...
- Nginx 日志切割(Logrotate)
Logrotate 配置文件 # ls /etc/logrotate.* /etc/logrotate.conf /etc/logrotate.d: cups dracut fmdcn httpd i ...
随机推荐
- Linux中mysql5.7主从配置
MySQL主从配置(两台Linux之间) 简介 Linux下MySQL数据库的主从同步用来实现读写分离.主数据库进行数据的插入,删除与更新:从数据库专门用来查询操作,缓解数据库的压力.让运行海量数据的 ...
- PAT L3-017. 森森快递
L3-017. 森森快递 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 俞勇(上海交通大学) 森森开了一家快递公司,叫森森快递.因为 ...
- django中使用事务以及接入支付宝支付功能
之前一直想记录一下在项目中使用到的事务以及支付宝支付功能,自己一直犯懒没有完,趁今天有点兴致,在这记录一下. 商城项目必备的就是支付订单的功能,所以就会涉及到订单的保存以及支付接口的引入.先来看看订单 ...
- 几个Python爬虫工具介绍
Request Requests 唯一的一个非转基因的 Python HTTP 库,人类可以安全享用 上面一句话 出自Requests官方文档的第一句,从而奠定了其逗逼的文档风格.类似的还有: 警告: ...
- 在Word指定位置插入富文本域值(html文本)
遇到此问题,首先想到的就是各种百度.结果度娘了一会并没有发现有用的有效的解决方法,哎,看来还得靠自己啊. 首先整理了下手头上的资源,一是HtmlAgilityPack,专门解析Html文本用的:二是我 ...
- python科学计算与可视化视频教程
目录: 下载链接:https://www.yinxiangit.com/616.html 第一单元TVTK入门-1.mp4第一单元TVTK入门-2.mp4第一单元TVTK入门-3.mp4 第一单元TV ...
- Log4Net 日志记录的实现
一.前言 在上一篇文章[(转载)非常完善的Log4net配置详细说明]介绍了Log4Net的配置说明,如果不知道的可以去看看,这里我们就介绍一下日志记录的实现,说得都比较基础,所以大神请绕过. 二.L ...
- java基础day2
Java标识符命名规则: 标识符由字母,下划线“_”.美元符号$或数字组成/ 不能以数字开头 区分大小写 不能是关键字 “ 见名知意” 约定俗成的规则 类名:首字母大写变量名:除第一个单词外小写,其他 ...
- 错误:java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.TestEBrand) from org.junit.internal.requests.ClassRequest@4f3cc73c
今天测试分页时出现以下错误: java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.Tes ...
- windows平台:查看端口占用情况,请杀死端口对应进程PID
//查看 netstat -ano | findstr //杀死 taskkill /f /PID