Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logrotate]

logrotate is a program which is scheduled (usually nightly or weekly) to archive log files by renaming them with a suffix so that the applications writing the log files start writing to new (empty) files.

0
votes
0answers
23 views

For rotating logs- Cronjob issue

Invoking logrotate every 15 mins. logrotate will rotate only after size threshold crosses 1M Working machine [root@machine1 output]# ls -l --block-size=1K total 296 -rw------- 1 root root 55 Oct ...
1
vote
1answer
20 views

How copytruncate actually works? [on hold]

we would like to understand copytruncate before rotating the file using logrotate with below configuration: /app/syslog-ng/custom/output/all_devices.log { size 200M copytruncate dateext ...
0
votes
1answer
20 views

How to logrotate 1 MB file?

To rotate logs after the size grows to 1M, cronjob invokes logrotate every 15 mins, as shown below: 0,15,30,45 * * * * /usr/sbin/logrotate /app/syslog-ng/custom/conf/syslog-ng-rotate.conf where ...
0
votes
0answers
29 views

Logrotate syslog-NG logging - RHEL 7.x

/usr/sbin/logrotate is used to log rotate syslog-NG logging, as shown below: [root@machine1 output]# crontab -l # 00 23 * * * /TSM/bkup 1>/dev/null 2>&1 1 * * * * /usr/sbin/logrotate /app/...
0
votes
0answers
14 views

Job `cron.daily' started not append in /var/log/cron

I created a logrotate job in /etc/logrotate.d, and config /etc/anacrontab because I expect the job will execute at 00:00:00, its content: SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root #...
1
vote
2answers
68 views

Logrotate: Run postrotate script with rotated file

I'm rotating log files with logrotate with copytruncate, and I need to run a script with the new filename as argument. I understand I can use $1 within postrotate, but that gives me the name of the ...
0
votes
0answers
29 views

The wildcard * in logrorate didn't work as i expected

I have a directory /var/log/httpd where there are many different log format inside it, some of them are www.sky.com-ssl-error_log.20180910 www.sky.com-ssl-access_log.20180910 www.sky.com-error_log....
0
votes
1answer
46 views

bash script - logrotate output rename

When executing logrotate it shows following: error: error creating output file /var/log/remote/172.29.202.29/contrail-vrouter-agent.log.1: File exists error: error creating output file /var/log/...
1
vote
0answers
28 views

Why does logrotate generate empty log files when using two wildcards in log path?

Logrotate will rotate the logs but when it renames the file to .1 (and then subsequently to .2.gz, .3.gz, etc) the files are empty. I've tracked this down to the path specified in the log config file: ...
0
votes
0answers
7 views

Logrotate File Numbering [UBUNTU 14.04]

root@osshonisyslog1s:/var/log/upstart# ls -Anh | grep graylog-server && vim /etc/logrotate.d/upstart -rw-r----- 1 0 0 3.0G Aug 21 11:32 graylog-server.log -rw-r----- 1 0 0 1.1G Aug 21 11:26 ...
0
votes
1answer
14 views

Logrotate Timing?

I've configured logrotation and it works the way I want it to when I force the update. I'm using the filesize condition as you can see in the config below, but I'm wondering how often this condition ...
0
votes
1answer
24 views

Upstart Logrotate?

What's wrong with my config? I had to --force the logrotate a couple times to see changes, but the numbering is all wonky. ----@----------:/var/log/upstart# ls -Anh total 4.0G -rw-r----- ...
1
vote
0answers
30 views

Where do Logrotate files end up?

I've got a Graylog server that I configured logrotating on. /var/lib/graylog-server/journal/messagejournal-0/000*.log { size 2G create 550 ubuntu ubuntu rotate 5 } I came in one morning ...
0
votes
1answer
50 views

Linux logrotate, how to configure logrotate to remove all logs older than one month?

We have Linux Red Hat servers - version 7.2. We have the following Hive logs under /var/log/hive. How can we configure the Linux logrotate so every log file that's older than one month will be ...
0
votes
0answers
30 views

Logrotate ignoring log file without suffix?

My problem is simple. I have 5 log files in a folder, like this: software1.txt, software2.txt, etc. My Logrotate script, as follows, runs daily: /var/ftp/logs/*.txt { daily rotate 36500 ...
0
votes
0answers
22 views

How to auto rotate screen with Gsensor on lxde?

Is there any software let can set auto rotate based on g-sensor value? Or I should design a program myself to execute it in background?
0
votes
2answers
65 views

How to copy desired log file content when logs are frequently being rotated in Linux [closed]

Suppose some logs is being rotated by size 50MB each . I did grep some string and my string is present in a log file, log_3 and I want to copy the content of log_3 before it gets rotated(renamed) to ...
0
votes
1answer
37 views

Best Practice: How to maintain/rotate log files (from redirected output)

I read several question for the mentioned topic, but I'm not sure if they really answer the question for my problem. I have an application running and I redirect the output to a log file, i.e., ...
0
votes
1answer
46 views

Log Rotation Duplicating

My log rotation is rotating the already rotated files. How can I stop this? Here's my log rotation file: /srv/logs/httpd/example.com/* /srv/logs/httpd/sub.example.com/* { daily size 200M ...
0
votes
2answers
654 views

Why is kill -HUP used in logrotate in RHEL? Is it necessary in all cases?

I see for syslog logging, kill -HUP is used. /var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler { sharedscripts postrotate /bin/kill -HUP `cat /var/run/...
0
votes
1answer
309 views

Logrotate copytruncate option taking too much time

I am running logrotate every 4 hours using crontab. I want to rotate files at every 50G which is expected in 4 hours. My logrotate.config is like below : /log/*/*/*/*.log { size 50G ...
0
votes
1answer
88 views

Logrotate doesn't recognise createolddir option (Debian)

I have found the createolddir command very useful for logrotate to dynamically clean up my log folders, and have this working successfully on other Debian servers without any problems. Just for one ...
0
votes
1answer
64 views

/var/lib/logrotate/status gets invalid entries

We are seeing our /var/lib/logrotate/status gets invalid entries like following: saurabh@1236:~$ cat /var/lib/logrotate/status logrotate state -- version 2 "/var/log/syslog" 2018-3-13 "/var/log/auth....
0
votes
0answers
108 views

NXLog File truncates

I am using NXLog to auto restart process and for email alerts. I also tried to use $Message = substr($raw_event, 0, 1000); But its still giving me the same problem. Due to this error, the S3 sink logs ...
1
vote
0answers
25 views

rsyslog cron.daily warning message

I am running Ubuntu 16.04 and cron is emailing me the following message /etc/cron.daily/logrotate: Warning: Stopping rsyslog.service, but it can still be activated by: syslog.socket I have not made ...
0
votes
0answers
41 views

How to make services reopen logs for write? (when partition of /var/log changes)

How to make services reopen logs for write? Need some universal solution, not configuring for each service. I use /usr/sbin/logrotate -f for that, but may there are some perfect solution? I need this ...
1
vote
1answer
480 views

logrotate permission denied

Why am I getting permission denied on renaming my log file when running logrotate? The owner of my log file shown below is rajohns which is the same user that is logged in running the logrotate ...
3
votes
1answer
219 views

Log rotate using perl Logfile::Rotate

The below script works when executed on CentOS, but it doesn't rotate logs based on size. A new log is generated every time I execute this script. Can anyone tell me how to make this script work based ...
-6
votes
1answer
56 views

Rename Oracle logs with the current date [duplicate]

I would like to rename my Oracle alert logs with the current date and compress them after X days. Could this be done with a shell script? Also I must not use logrotate
2
votes
1answer
707 views

Logrotate Tomcat log file

I am writing Tomcat log with this setting: Log configured using an AccessLogValve in server.xml Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access" prefix="access" ...
0
votes
1answer
95 views

Linux is spamming me now (anacron)

Since about a year ago, linux Debian has been spamming me with messages like the following: Subject: Anacron job 'cron.daily' on mymachine Content-Type: text/plain; charset=UTF-8 Date: Mon, 3 Apr ...
1
vote
1answer
47 views

what if two logrotate run concurrently

I know this sounds weird... I have a project which will run "logrotate myConf.conf" automatically every hour. Besides, in my cron/, there is also a logrotate running... The two process might have ...
0
votes
1answer
2k views

Logrotate daily+maxsize is not rotating

I've CentOS 7.4 with logrotate 3.8.6 installed. I've a custom logrotate file under /etc/logrotate.d/ to rotate some logs on a Tomcat (e.g., catalina.out) which is installed in the same machine. /opt/...
1
vote
1answer
380 views

how to get rotations with the date of the previous day?

Every day at midnight, the achievement processes with logrotate begin, which I have set up. But I'm faced with the problem that once the rotation is finished, it has the name of the current day and I'...
1
vote
1answer
77 views

Transfer old log files before they are deleted by logrotate

I'm using Debian Stretch on my server. Here is the relevant portion of etc/logrotate.d/rsyslog: /var/log/mail.info /var/log/mail.warn /var/log/mail.err /var/log/mail.log { rotate 4 ...
0
votes
1answer
501 views

Can the logrotate descriptor handle multiple wildcards?

For example, on a syslog collector, where remote syslog is coming into /var/syslog/<host>/*.log, can I have something like the following in my logrotate config: /var/syslog/*/*.log { daily ...
0
votes
2answers
2k views

Why is logrotate not automatically rotated?

I've set you up to rotate daily, but you don't. But when I do it manually, it does work. logrotate -vf /etc/logrotate.conf This is my log file to rotate. /mylogs/log (-rwxrwxrwxrwx 1 admin admin) ...
0
votes
0answers
298 views

Logrotate application logs on NFS

I have a Centos 7 NFS server that serves files to a Centos 7 web server. I am trying to setup logrotate to rotate some application logs. When I run logorate manually it works as intended but the logs ...
1
vote
2answers
938 views

Accidentally set chmod 777 to /var/log

So I've set chmod 777 -R to /var/log on Raspbian and now I get some errors when logrotate runs. The errors are like: error: skipping "/var/log/apt/term.log" because parent directory has insecure ...
3
votes
0answers
194 views

Logrotate not working with cron

I have created my logrotate file inside logrotate.d folder. When I run it manually using logrotate command, it is rotating the logs correctly. But the daily cron seems not to be running. crontab -l is ...
0
votes
0answers
89 views

rotate log unable te delete old files

With apache i decide to manage log with logrotate i wanted to keep logs for 60 days, older than that must be deleted, so i added the following : /var/log/httpd/* { daily size 10M rotate 15 maxage 60 ...
1
vote
0answers
626 views

maxage option in logrotate not working as expected

I am rotating my logs using logrotate in linux. I want to remove my logs older than 7 days. So I tried maxage option in logrotate but it is not working as expected. Let say I have 6 logs which is ...
0
votes
2answers
515 views

fail2ban:11 lines must begin with a keyword or a filename (possibly in double quotes)

I am rotating the logs of my Fail2Ban service on a daily basis, but, I keep getting this error on a daily basis: /etc/cron.daily/logrotate: error: fail2ban:11 lines must begin with a keyword or a ...
0
votes
0answers
32 views

Application log file not growing after 2Gig

I've an application installed in RHEL 7.1 3.1 kernal 64 bit. In my application we haven't configured log rotation. So, expecting log file should grow indefinitely. But the log file is not growing ...
1
vote
0answers
941 views

Logrotate rotate not working

I have a bunch of messages files in /var/log that stretches all the way to April of 2017 (not posting the whole output of ls as there are a lot of files) The archived messages go from messages.2.gz to ...
5
votes
4answers
1k views

How can I properly override logrotate policies?

Various Debian packages, including logrotate and rsyslog, put their own log rotation definitions in /etc/logrotate.d/ What is the correct way to override those definitions? If I modify the files, I ...
1
vote
1answer
443 views

How to append the date to log file before it's name?

I want to append the date to my log file before its name. /opt/logs/myapp.log { rotate 6 hourly dateext dateformat %Y-%m-%d ifempty postrotate ...
1
vote
0answers
39 views

Is logrotate -f not supposed to be used anymore?

So I wanted to logrotate all my logs today and in particular "named" logs for a debug purpose. But it seems that it is not possible in today's Debian-based distributions. Even if it seems to work ...
4
votes
1answer
3k views

Ignoring /etc/logrotate.conf because of bad file mode

How can I do logrotate, i can see no effect when i do logrotate root@me-Latitude-E5550:/etc/logrotate.d# cd .. root@me-Latitude-E5550:/etc# cd .. root@me-Latitude-E5550:/# logrotate -d /etc/logrotate....
0
votes
0answers
133 views

kern.log has nine stop print rsyslogd:,imklog: error reading kernel log - shutting down: Bad file descriptor

I use linux on embedded system that use kern.log print outputs of RF drivers that stored on kern.log. Recently for some reason I start get none stop messages of : rsyslogd:,imklog: error reading ...