logrotate

Tomcat7 logrotate: superx_default_xml.log.gz already exists

二次信任 提交于 2019-12-11 06:08:33
问题 Every day I get a mail with the following error message from my cron: /etc/cron.daily/tomcat7: gzip: /var/log/tomcat7/superx_default_xml.log.gz already exists; not overwritten gzip: /var/log/tomcat7/superx.log.gz already exists; not overwritten gzip: /var/log/tomcat7/superx-dbforms.log.gz already exists; not overwritten gzip: /var/log/tomcat7/saiku.log.gz already exists; not overwritten gzip: /var/log/tomcat7/superx_default.log.gz already exists; not overwritten I´ve installed Tomcat7 on a

Tomcat8 on Ubuntu .log.gz already exists not overwritten

别来无恙 提交于 2019-12-11 02:12:29
问题 On our Tomcat servers I regularly see warnings like below: /etc/cron.daily/tomcat8: gzip: /var/log/tomcat8/app1/app1.log.gz already exists; not overwritten gzip: /var/log/tomcat8/app2/app2.log.gz already exists; not overwritten gzip: /var/log/tomcat8/app3/app3.log.gz already exists; not overwritten gzip: /var/log/tomcat8/app4/app4.log.gz already exists; not overwritten I found a similar issue as discussed in Tomcat7 logrotate: superx_default_xml.log.gz already exists however an answer was

docker image ubuntu:16.04 seems to omit some files for logrotate

China☆狼群 提交于 2019-12-10 21:00:08
问题 I built an image based on ubuntu:16.04 . While building the image I did run some commands including apt-get -y update . Then, I browse the image by docker run -it myimage bash and I found there are some omitted files for logrotate in there comparing to normal ubuntu16.04 OS. For instance, /etc/logrotate.conf , /usr/sbin/logrotate , /var/lib/logrotate/status . I could't find them anywhere even with running find / -name logrotate* . the find command only show /etc/logrotate.d ( /etc/cron.daily

rsync and logrotate transfers old logs every day

懵懂的女人 提交于 2019-12-10 18:44:02
问题 I have Apache web server producing considerable amount of log files. I do logrotate them every day on the server. Every night I rsync server backups over Internet to another computer. The speedup of log files sync is very close to 1, because logrotate renames all the files and rsync treat them as totally different, because they really are. I guess this is common problem, what tools would you recommend me to use. I want to keep some history of logs (like 50 days) on the server and whole log

Linux 日志定时轮询流程详解

一曲冷凌霜 提交于 2019-12-10 06:39:08
来源:cooffeelis www.jianshu.com/p/ea7c2363639c logrotate介绍 对于Linux系统安全来说,日志文件是极其重要的工具。日志文件包含了关于系统中发生的事件的有用信息,在排障过程中或者系统性能分析时经常被用到。当日志文件不断增长的时候,就需要定时切割,否则,写日志的速度和性能也会下降,更不便于我们归档,查询。 所以便有了使用logrotate的时候 ,logrotate是个十分有用的工具,它可以自动对日志进行截断(或轮循)、压缩以及删除旧的日志文件。例如,你可以设置logrotate,让/var/log/foo日志文件每30天轮循,并删除超过6个月的日志。配置完后,logrotate的运作完全自动化,不必进行任何进一步的人为干预。 logrotate配置文件位置 Linux系统默认安装logrotate工具,它默认的配置文件在: /etc/logrotate.conf /etc/logrotate.d/ logrotate.conf 才主要的配置文件,logrotate.d 是一个目录,该目录里的所有文件都会被主动的读入/etc/logrotate.conf中执行。 另外,如果 /etc/logrotate.d/ 里面的文件中没有设定一些细节,则会以/etc/logrotate.conf这个文件的设定来作为默认值。 实际运行时

On Windows, how to open for writing a file already opened for writing by another process?

折月煮酒 提交于 2019-12-09 18:40:45
问题 I'm trying to open a logfile which is kept open by another process and remove the first few lines. On Unix I'd simply do a os.open('/tmp/file.log', os.O_NONBLOCK) and that would get me closer to my goal. Now i'm stuck with Windows and I need to rotate this log somehow without ending the application holding the file. Is this even possible? At first I considered opening a file handle on the location where the application expected the log to be and just act as a pipe into a file-handle in Python

0516第二十一次课:LNMP 2

做~自己de王妃 提交于 2019-12-07 12:20:16
LNMP 2 一、nginx默认虚拟主机 在Nginx中也有默认虚拟主机,跟httpd类似,第一个被Nginx加载的虚拟主机就是默认主机,但和httpd不相同的地方是,它还有一个配置用来标记默认虚拟主机,也就是说,如果没有这个标记,第一个虚拟主机为默认虚拟主机。 设置nginx默认虚拟主机 vim /usr/local/nginx/conf/nginx.conf 删除以下标红的地方: 添加以下内容: include vhost/*.conf; 创建虚拟主机文件 创建vohost文件 mkdir /usr/local/nginx/conf/vhost vim test.conf 添加以下内容: server { #default_server 表示就是一个虚拟主机 listen 80 default_server; server_name wxy.com; index index.html index.htm index.php; root /data/wwwroot/wxy.com; } 创建默认目录 mkdir -p /data/wwwroot/wxy.com/ 新建index.html vim /data/wwwroot/wxy.com/index.html 添加以下内容: this is test 检查配置文件 ./nginx -t 重新加载 ./nginx -s

个人服务器docker使用管理

丶灬走出姿态 提交于 2019-12-07 10:09:14
docker部署 安装文档: https://docs.docker.com/install/linux/docker-ce/centos 清理老的版本 sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine 准备依赖环境 sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 rpm离线安装方式 yum install docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm systemctl start docker #https://download.docker.com/linux/centos/7/x86_64/stable/Packages #docker rpm包 yum在线安装 sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo # 添加Docker软件包源 sudo

logrotate dateformat seems not supporting %H:%M:%S

浪子不回头ぞ 提交于 2019-12-06 19:02:53
问题 I am newer to logrotate. when the configure comes to the property "dateformat",it seems that logrotate doesn't support strftime "%H" . here is the config: { daily rotate 2 size 3M missingok notifempty dateext dateformat -%Y%m%d_%H:%M:%S ... } the rotated file format tend to look like : uwsgi_dev.log-20150630_%H:%M:%S, but I want the exact "hour minutes and seconds". thanks 回答1: Support for %H was added in version 3.9.0. In earlier versions, logrotate did not support strftime "%H: dateformat

Cenos Docker 安装

柔情痞子 提交于 2019-12-06 15:07:21
https://www.runoob.com/docker/centos-docker-install.html 卸载旧版本 较旧的 Docker 版本称为 docker 或 docker-engine 。如果已安装这些程序,请卸载它们以及相关的依赖项。 $ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine 安装 Docker Engine-Community 使用 Docker 仓库进行安装 在新主机上首次安装 Docker Engine-Community 之前,需要设置 Docker 仓库。之后,您可以从仓库安装和更新 Docker。 设置仓库 安装所需的软件包。yum-utils 提供了 yum-config-manager ,并且 device mapper 存储驱动程序需要 device-mapper-persistent-data 和 lvm2。 $ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2