LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-19-2019, 07:13 AM   #1
cesarsj
Member
 
Registered: Mar 2019
Location: Patos de Minas, MG, Brazil
Distribution: Slackware
Posts: 159

Rep: Reputation: Disabled
Question Logrotate: Why did uncompressed logs remain?


I enabled the compress option in logrotate, so after a while, when I was warned that there was little disk space, I saw that the uncompressed logs, dated months ago, were still in / var / log. Should logrotate not auto-replace? Why when, for example, did syslog.94.gz not delete syslog.94?
 
Old 11-19-2019, 07:17 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by cesarsj View Post
I enabled the compress option in logrotate, so after a while, when I was warned that there was little disk space, I saw that the uncompressed logs, dated months ago, were still in / var / log. Should logrotate not auto-replace? Why when, for example, did syslog.94.gz not delete syslog.94?
This all depends on your logrotate.conf file as well as how you run logrotate. Please share more details about both so that people can evaluate your problem better.
 
Old 11-19-2019, 07:53 AM   #3
cesarsj
Member
 
Registered: Mar 2019
Location: Patos de Minas, MG, Brazil
Distribution: Slackware
Posts: 159

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
This all depends on your logrotate.conf file as well as how you run logrotate. Please share more details about both so that people can evaluate your problem better.
# rotate log files weekly:
daily

# keep 4 weeks worth of backlogs:
rotate 360

# create new (empty) log files after rotating old ones:
create

# uncomment if you want to use the date as a suffix of the rotated file
#dateext

# uncomment this if you want your log files compressed:
compress

# some packages install log rotation information in this directory:
include /etc/logrotate.d

# Rotate /var/log/wtmp:
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 1
}

# Rotate /var/log/btmp:
/var/log/btmp {
monthly
create 0600 root root
rotate 1
}
 
Old 11-19-2019, 08:03 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
compress alone does not delete the files, either the rotate number does this, or maxage. You also can run a post-rotate script which can remove the original logs which were compressed.
 
Old 11-19-2019, 08:23 AM   #5
cesarsj
Member
 
Registered: Mar 2019
Location: Patos de Minas, MG, Brazil
Distribution: Slackware
Posts: 159

Original Poster
Rep: Reputation: Disabled
I understand, as long as there are no 360 files in a given log, the oldest will not be deleted. Counting has resumed on compressed file names, but the date of the logs is sequential.
 
  


Reply

Tags
logrotate



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
Back up logs file and create a script showing the backed up logs and the running logs Billy_6052 Programming 5 12-13-2014 02:32 AM
[SOLVED] logrotate or logrotate.conf; problems with sftp slufoot80 Linux - Server 1 11-05-2011 07:50 AM
logrotate - How to delete uncompressed logs diamond_D Linux - Newbie 4 11-03-2011 09:57 PM
Audio - uncompressed file format Beuzekom Linux - Software 3 02-10-2004 08:53 AM
VM could not be uncompressed Colluru Linux - Software 2 02-04-2004 12:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:52 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