我正在使用名为UrBackup的备份软件,我configuration为通过cron.daily每天轮换一次日志。 日志旋转后,软件使用postrotate脚本来向运行进程发送一个带有“systemctl kill”的HUP信号。 然而,SELinux拒绝这个操作,我不知道如何解决这个问题。 这是来自/etc/logrotate.d的UrBackup的整个logrotateconfiguration文件: "/var/log/urbackup.log" { daily rotate 30 missingok create 640 urbackup urbackup compress postrotate test -e /var/run/urbackupsrv.pid && kill -HUP 'cat /var/run/urbackupsrv.pid' || /bin/systemctl kill -s HUP urbackup-server.service endscript } 正如我所发现的那样,系统上正在执行以下有问题的postrotate脚本: /bin/systemctl kill -s HUP urbackup-server.service SELinux阻止了这一点。 以下是/ var / log / messages中的相关日志条目: Nov 14 03:33:33 backup4 kernel: type=1107 audit(1510648413.518:4407695): pid=1 uid=0 […]
我正在研究的事情之一是使用logrotate的dateext选项。 但是,如果我正确地理解事情apache将继续写入文件access.log和error.log。 我想知道是否有一种方法来使apache日志文件access.log.YYYYMMDD和error.log.YYYYMMDD,而不是? YYYYMMDD是创build文件时的时间戳。
我有这种情况在我的服务器上的日志文件/var/log/auth.log已经增长了很大的尺寸。很多networking服务器正在运行它和类似的东西我看到日志条目,因为15天没有被logging。 我一直在做我的局域网上的SSH和家我所指的服务器是有一个公共的IP,但我看到日志条目是从过去12天在/var/log/auth.log.What可以这个检查存储日志的目录的大小是3.7 GB的原因,这可能是一个问题?
我一直在研究我的服务器的日志轮换主机〜5个相当高的stream量站点。 从我可以告诉,我的select是使用logrotate或使用旋转日志或chronologpipe道日志logging。 logrotate需要重新启动apache,并且SIGHUP和SIGUSR1重新启动在高stream量站点上都不太理想,因为要么放弃一堆连接,要么延迟压缩旧日志,直到所有subprocess自然死亡。 另外,如果启用压缩,停机时间可能非常重要。 将使用logrotate – 没有压缩和平稳的重新启动 – 事后压缩旧日志是最大限度地减less停机时间的最佳方式? chronolog和rotatelogs听起来很有希望,但没有很好的文档。 我无法find与虚拟机特定日志结合使用的示例。 该chronolog网站说:“当扩展的文件名更改,当前文件被closures,并打开一个新的。 这是全球性的吗? 或者是每个AccessLog,CustomLog或ErrorLog指令? chronolog和rotatelog之间有明显的区别吗?
我有一个日志文件,我的服务使得文件名为“Feed1 – 1.stat”。 logrotate拒绝旋转此文件,但只有在通过cron运行时 。 通过shell运行logrotate将正确地旋转文件。 更改configuration和日志文件没有空格也会导致文件正确旋转。 下面是剧本脚本的相关部分: "/opt/myservice/statistics/continuous/Feed1 – 1.stat" { rotate 60 daily missingok notifempty compress delaycompress postrotate /usr/bin/killall -HUP myservice endscript } 这里是启动logrotate的cron条目(Ubuntu默认): #!/bin/sh # Clean non existent log file entries from status file cd /var/lib/logrotate head -1 status > status.clean sed 's/"//g' status | while read logfile date do [ -e […]
我使用着名的Windows 7和Cygwin的logrotate,我有最新的cygwin DLL,但不知何故应用程序不工作,configuration文件似乎是好的。 有没有人遇到过这个? 我的configuration文件是这样的 nocreate /cygdrive/c/log/*.log { daily rotate 14 nocompress nocopytruncate } 和控制台给我一个意想不到的文本错误,也说,指定的目录无法find。 编辑: error: logrotate.conf:1 unexpected text error: logrotate.conf:2 lines must begin with a keyword or a filename (possibly in double quotes) error: logrotate.conf:3 unexpected text error: logrotate.conf:4 unexpected text error: logrotate.conf:5 unexpected text error: logrotate.conf:6 unexpected text error: logrotate.conf:7 lines must […]
什么实际上在CentOS 6.3中调用logrotate ? 我查看了/etc/init.d但是没有和logrotate关联。 另外, root用户的crontab没有任何内容。 谢谢。
MySQL有一个日常的日志轮换系统吗? 像创build每日日志文件的Apache? 我很难find有关这方面的好消息。 Win Server 2008 R2 MySQL 5.1.11 我正在logging所有(普通)查询,日志文件大小变得非常快。 很高兴每天分一次。
我已经在/etc/logrotation.d/custom目录下的名为custom Ubuntu服务器上configuration了日志轮转,条目如下 /var/log/apache2/access.log { daily mailfirst [email protected] missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi; \ endscript } 但是当我运行命令logrotate -f /etc/logrotate.d/custom时会出现以下错误。 logrotate -f custom error: custom:3 unexpected text 它在mailfirst [email protected]发出错误。 为什么? 请帮忙。
我正在尝试设置logrotate。 我得到意想不到的结果; 一些日志文件的大小有多个date和/或零字节。 我想每天都有一个日志,并在旧日志的文件名中包含date,而只保留最近30天的日志。 这里是我的logrotate条目 /var/www/html/joomla-1.x/example.com/logs/*.log { missingok daily dateext extension .log rotate 30 notifempty sharedscripts nocompress postrotate /sbin/service httpd reload > /dev/null 2>/dev/null || true endscript } 以下是蜜蜂旋转的日志文件。 [root@Webserver-2 logs]# ls -la total 72460 drwxrwxr-x. 2 apache apache 28672 Jan 13 03:08 . drwxrwxr-x. 4 apache apache 4096 Nov 21 12:51 .. -rw-r–r–. 1 […]