LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2017, 05:26 AM   #1
Jerome.d
LQ Newbie
 
Registered: Feb 2017
Location: France
Posts: 4

Rep: Reputation: Disabled
Logrotate don't work with my log format


Hello,
I have problem with Logrotate.
my log names have this format :

Code:
imap-2017-01-02.log
imap-2017-01-08.log
imap-2017-01-13.log
...
my logrotate config file containt :

Code:
/var/log/qspot/*.log {
        daily
        rotate 7
        copytruncate
        compress
        delaycompress
        create 640 root
        missingok
        notifempty
}
And when i launch Logrotate, I have this result :

Code:
rotating pattern: /var/log/qspot/*.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/qspot/imap-2017-01-02.log
  log does not need rotating
considering log /var/log/qspot/imap-2017-01-04.log
  log does not need rotating
considering log /var/log/qspot/imap-2017-01-05.log
  log does not need rotating
considering log /var/log/qspot/imap-2017-01-06.log
  log does not need rotating...
It sees all my files, but as it is one per day, it does not take into account the parameters of rotation

I understand that I do not use the correct syntax, but I can not find examples for this format of log.

Of course, I do not change the name of my log files

Can you help me ?
 
Old 02-01-2017, 06:01 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
What's the output of?
Code:
ls -l /var/log/qspot/*.log
 
Old 02-01-2017, 07:08 AM   #3
Jerome.d
LQ Newbie
 
Registered: Feb 2017
Location: France
Posts: 4

Original Poster
Rep: Reputation: Disabled
Code:
root@GRELPSUP229:/etc/logrotate.d# ls -l /var/log/qspot/*.log
-rw-r--r-- 1 logstash logstash  24448 janv. 22 03:00 /var/log/qspot/imap-2017-01-02.log
-rw-r--r-- 1 logstash logstash 125312 janv. 22 03:00 /var/log/qspot/imap-2017-01-04.log
-rw-r--r-- 1 logstash logstash 302005 janv. 22 03:00 /var/log/qspot/imap-2017-01-05.log
-rw-r--r-- 1 logstash logstash 962275 janv. 19 11:53 /var/log/qspot/imap-2017-01-06.log
-rw-r--r-- 1 logstash logstash 442124 janv. 19 11:53 /var/log/qspot/imap-2017-01-07.log
-rw-r--r-- 1 logstash logstash  20439 janv. 19 11:53 /var/log/qspot/imap-2017-01-08.log
-rw-r--r-- 1 logstash logstash 432597 janv. 22 03:00 /var/log/qspot/imap-2017-01-09.log
-rw-r--r-- 1 logstash logstash 498428 janv. 19 11:54 /var/log/qspot/imap-2017-01-10.log
-rw-r--r-- 1 logstash logstash 676182 janv. 22 03:00 /var/log/qspot/imap-2017-01-11.log
-rw-r--r-- 1 logstash logstash 465983 janv. 19 11:54 /var/log/qspot/imap-2017-01-12.log
-rw-r--r-- 1 logstash logstash 429288 janv. 19 11:54 /var/log/qspot/imap-2017-01-13.log
-rw-r--r-- 1 logstash logstash 487157 janv. 19 11:54 /var/log/qspot/imap-2017-01-14.log
-rw-r--r-- 1 logstash logstash  53281 janv. 19 11:54 /var/log/qspot/imap-2017-01-15.log
-rw-r--r-- 1 logstash logstash 379475 janv. 22 03:00 /var/log/qspot/imap-2017-01-16.log
-rw-r--r-- 1 logstash logstash 425763 janv. 19 11:54 /var/log/qspot/imap-2017-01-17.log
-rw-r--r-- 1 logstash logstash 486805 janv. 19 11:54 /var/log/qspot/imap-2017-01-18.log
-rw-r--r-- 1 logstash logstash 470536 janv. 19 21:20 /var/log/qspot/imap-2017-01-19.log
-rw-r--r-- 1 logstash logstash 660484 janv. 22 03:00 /var/log/qspot/imap-2017-01-20.log
-rw-r--r-- 1 logstash logstash 417603 janv. 21 21:10 /var/log/qspot/imap-2017-01-21.log
 
Old 02-02-2017, 05:28 PM   #4
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
Hi! logrotate is one of the things I want to learn... Here's a couple *WILD guesses*: [man]

"It will not modify a log multiple times in one day unless the criterium for that log is based on the log’s size and logrotate is being run multiple times each day, or unless the
-f or -force option is used." ...
-v Turn on verbose mode.

/var/lib/logrotate.status Default state file. [what's in here??]
"How logrotate remembers...": https://support.rackspace.com/how-to...oubleshooting/

"The debug flag, “-d”, tells logrotate to go through the motions of rotating logs but not actually rotate them. It can be handy if you want to test a new config file but don’t want any actual log rotation run when you do (if you’re working on a production server, for example)."

>-rw-r--r-- 1 logstash logstash 24448 janv. 22 03:00 /var/log/qspot/imap-2017-01-02.log
The *recent* janv.22 vs. -01-02.log scared me for a moment, but probably -not- an issue.

I **welcome other LQ'ers input here!**

Last edited by Jjanel; 02-02-2017 at 05:32 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] logrotate logs to log.1 instead of to default log yzT! Linux - Server 1 10-01-2014 03:15 AM
kernel log format in /var/log/kern.log sinu_nayak2001 Linux - Newbie 2 10-07-2009 08:34 AM
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 04:14 PM
Mouse/Keyboard don't work at log in screen with Fedora 11 preview HamScott Fedora 2 07-12-2009 07:49 AM
Logrotate: don't seem to be able to restart service (apache) Swakoo Linux - General 10 02-09-2008 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration