logrotate deletes all maillogs older than one day The Next CEO of Stack Overflowlogrotate problemsLogrotate Successful, original file goes back to original sizeHow do I tell logrotate what files to rotate with cron?logrotate fails to instruct Apache to reopen logs on Amazon LinuxLogrotate doesn't work from cron on CentOSHow to rotate log based on an interval unless log exceeds a certain size?logrotate cron job not rotating certain logsRsyslog stops sending data to remote server after log rotationSyslog-ng and Logrotate creating sparse filesSELinux denies “systemctl kill” when used in Anacron postrotate script on CentOS 7

Reference request: Grassmannian and Plucker coordinates in type B, C, D

Why is my new battery behaving weirdly?

Why isn't the Mueller report being released completely and unredacted?

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Powershell. How to parse gci Name?

Is wanting to ask what to write an indication that you need to change your story?

RigExpert AA-35 - Interpreting The Information

Bartok - Syncopation (1): Meaning of notes in between Grand Staff

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Do I need to write [sic] when a number is less than 10 but isn't written out?

Won the lottery - how do I keep the money?

Math-accent symbol over parentheses enclosing accented symbol (amsmath)

Does soap repel water?

Method for adding error messages to a dictionary given a key

Does it make sense to invest money on space investigation?

INSERT to a table from a database to other (same SQL Server) using Dynamic SQL

How many extra stops do monopods offer for tele photographs?

Solving system of ODEs with extra parameter

Why does the flight controls check come before arming the autobrake on the A320?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

Why did CATV standarize in 75 ohms and everyone else in 50?

How to count occurrences of text in a file?

Some questions about different axiomatic systems for neighbourhoods

Writing differences on a blackboard



logrotate deletes all maillogs older than one day



The Next CEO of Stack Overflowlogrotate problemsLogrotate Successful, original file goes back to original sizeHow do I tell logrotate what files to rotate with cron?logrotate fails to instruct Apache to reopen logs on Amazon LinuxLogrotate doesn't work from cron on CentOSHow to rotate log based on an interval unless log exceeds a certain size?logrotate cron job not rotating certain logsRsyslog stops sending data to remote server after log rotationSyslog-ng and Logrotate creating sparse filesSELinux denies “systemctl kill” when used in Anacron postrotate script on CentOS 7










0















I see only two files maillog and maillog.1 in /var/log.



grepping for maillog in logrotate.d directory gives three files that have a mention of maillog.



syslog



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
#/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron


syslog-ng



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log /var/log/kern 
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null


and maillog.



/var/log/maillog true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null


I am new to logrotate so may be I am missing something obvious. What can be the issue? The setup was already done when I started managing the server so I don't also know as do why do I have 3 mentions for maillog in logrotate.










share|improve this question














bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you also post your default logrotate configuration /etc/logrotate.conf?

    – panaroik
    Sep 20 '12 at 9:55












  • @panaroik Please find the defaults here sprunge.us/CQFF

    – Abhijeet Rastogi
    Sep 20 '12 at 10:21















0















I see only two files maillog and maillog.1 in /var/log.



grepping for maillog in logrotate.d directory gives three files that have a mention of maillog.



syslog



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
#/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron


syslog-ng



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log /var/log/kern 
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null


and maillog.



/var/log/maillog true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null


I am new to logrotate so may be I am missing something obvious. What can be the issue? The setup was already done when I started managing the server so I don't also know as do why do I have 3 mentions for maillog in logrotate.










share|improve this question














bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you also post your default logrotate configuration /etc/logrotate.conf?

    – panaroik
    Sep 20 '12 at 9:55












  • @panaroik Please find the defaults here sprunge.us/CQFF

    – Abhijeet Rastogi
    Sep 20 '12 at 10:21













0












0








0








I see only two files maillog and maillog.1 in /var/log.



grepping for maillog in logrotate.d directory gives three files that have a mention of maillog.



syslog



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
#/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron


syslog-ng



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log /var/log/kern 
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null


and maillog.



/var/log/maillog true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null


I am new to logrotate so may be I am missing something obvious. What can be the issue? The setup was already done when I started managing the server so I don't also know as do why do I have 3 mentions for maillog in logrotate.










share|improve this question














I see only two files maillog and maillog.1 in /var/log.



grepping for maillog in logrotate.d directory gives three files that have a mention of maillog.



syslog



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
#/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron


syslog-ng



/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/kern.log /var/log/kern 
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null


and maillog.



/var/log/maillog true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null


I am new to logrotate so may be I am missing something obvious. What can be the issue? The setup was already done when I started managing the server so I don't also know as do why do I have 3 mentions for maillog in logrotate.







log-files logrotate






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 20 '12 at 9:16









Abhijeet RastogiAbhijeet Rastogi

167116




167116





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Can you also post your default logrotate configuration /etc/logrotate.conf?

    – panaroik
    Sep 20 '12 at 9:55












  • @panaroik Please find the defaults here sprunge.us/CQFF

    – Abhijeet Rastogi
    Sep 20 '12 at 10:21

















  • Can you also post your default logrotate configuration /etc/logrotate.conf?

    – panaroik
    Sep 20 '12 at 9:55












  • @panaroik Please find the defaults here sprunge.us/CQFF

    – Abhijeet Rastogi
    Sep 20 '12 at 10:21
















Can you also post your default logrotate configuration /etc/logrotate.conf?

– panaroik
Sep 20 '12 at 9:55






Can you also post your default logrotate configuration /etc/logrotate.conf?

– panaroik
Sep 20 '12 at 9:55














@panaroik Please find the defaults here sprunge.us/CQFF

– Abhijeet Rastogi
Sep 20 '12 at 10:21





@panaroik Please find the defaults here sprunge.us/CQFF

– Abhijeet Rastogi
Sep 20 '12 at 10:21










1 Answer
1






active

oldest

votes


















0














  • The first one is created by default.

  • The second one is created when installing syslog-ng.

  • The previous sysadmin creates the third one manually (maybe).

Which syslog service are you running?



ps -ef | grep syslog



UPDATE



Since you're using syslog-ng, all of the postrotate scripts are wrong, change it to something like this:



postrotate
/bin/kill -HUP `cat /opt/syslog-ng/var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript


then run in debug mode (no changes will be made to the logs) to see what happens:



logrotate -d -f /etc/logrotate.d/syslog-ng





share|improve this answer

























  • /opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

    – Abhijeet Rastogi
    Sep 20 '12 at 9:48











  • ls -l /var/log/maillog.1?

    – quanta
    Sep 20 '12 at 14:36











  • sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

    – Abhijeet Rastogi
    Sep 21 '12 at 5:18











  • Which part did you remove? updated my answer.

    – quanta
    Sep 21 '12 at 6:48











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f430175%2flogrotate-deletes-all-maillogs-older-than-one-day%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














  • The first one is created by default.

  • The second one is created when installing syslog-ng.

  • The previous sysadmin creates the third one manually (maybe).

Which syslog service are you running?



ps -ef | grep syslog



UPDATE



Since you're using syslog-ng, all of the postrotate scripts are wrong, change it to something like this:



postrotate
/bin/kill -HUP `cat /opt/syslog-ng/var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript


then run in debug mode (no changes will be made to the logs) to see what happens:



logrotate -d -f /etc/logrotate.d/syslog-ng





share|improve this answer

























  • /opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

    – Abhijeet Rastogi
    Sep 20 '12 at 9:48











  • ls -l /var/log/maillog.1?

    – quanta
    Sep 20 '12 at 14:36











  • sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

    – Abhijeet Rastogi
    Sep 21 '12 at 5:18











  • Which part did you remove? updated my answer.

    – quanta
    Sep 21 '12 at 6:48















0














  • The first one is created by default.

  • The second one is created when installing syslog-ng.

  • The previous sysadmin creates the third one manually (maybe).

Which syslog service are you running?



ps -ef | grep syslog



UPDATE



Since you're using syslog-ng, all of the postrotate scripts are wrong, change it to something like this:



postrotate
/bin/kill -HUP `cat /opt/syslog-ng/var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript


then run in debug mode (no changes will be made to the logs) to see what happens:



logrotate -d -f /etc/logrotate.d/syslog-ng





share|improve this answer

























  • /opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

    – Abhijeet Rastogi
    Sep 20 '12 at 9:48











  • ls -l /var/log/maillog.1?

    – quanta
    Sep 20 '12 at 14:36











  • sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

    – Abhijeet Rastogi
    Sep 21 '12 at 5:18











  • Which part did you remove? updated my answer.

    – quanta
    Sep 21 '12 at 6:48













0












0








0







  • The first one is created by default.

  • The second one is created when installing syslog-ng.

  • The previous sysadmin creates the third one manually (maybe).

Which syslog service are you running?



ps -ef | grep syslog



UPDATE



Since you're using syslog-ng, all of the postrotate scripts are wrong, change it to something like this:



postrotate
/bin/kill -HUP `cat /opt/syslog-ng/var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript


then run in debug mode (no changes will be made to the logs) to see what happens:



logrotate -d -f /etc/logrotate.d/syslog-ng





share|improve this answer















  • The first one is created by default.

  • The second one is created when installing syslog-ng.

  • The previous sysadmin creates the third one manually (maybe).

Which syslog service are you running?



ps -ef | grep syslog



UPDATE



Since you're using syslog-ng, all of the postrotate scripts are wrong, change it to something like this:



postrotate
/bin/kill -HUP `cat /opt/syslog-ng/var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript


then run in debug mode (no changes will be made to the logs) to see what happens:



logrotate -d -f /etc/logrotate.d/syslog-ng






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 21 '12 at 6:47

























answered Sep 20 '12 at 9:31









quantaquanta

43.3k15114196




43.3k15114196












  • /opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

    – Abhijeet Rastogi
    Sep 20 '12 at 9:48











  • ls -l /var/log/maillog.1?

    – quanta
    Sep 20 '12 at 14:36











  • sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

    – Abhijeet Rastogi
    Sep 21 '12 at 5:18











  • Which part did you remove? updated my answer.

    – quanta
    Sep 21 '12 at 6:48

















  • /opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

    – Abhijeet Rastogi
    Sep 20 '12 at 9:48











  • ls -l /var/log/maillog.1?

    – quanta
    Sep 20 '12 at 14:36











  • sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

    – Abhijeet Rastogi
    Sep 21 '12 at 5:18











  • Which part did you remove? updated my answer.

    – quanta
    Sep 21 '12 at 6:48
















/opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

– Abhijeet Rastogi
Sep 20 '12 at 9:48





/opt/syslog-ng/sbin/syslog-ng --no-caps. So, why are logs only 1 day old wven though I have set rotate 14 in maillog.

– Abhijeet Rastogi
Sep 20 '12 at 9:48













ls -l /var/log/maillog.1?

– quanta
Sep 20 '12 at 14:36





ls -l /var/log/maillog.1?

– quanta
Sep 20 '12 at 14:36













sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

– Abhijeet Rastogi
Sep 21 '12 at 5:18





sprunge.us/IfDY. I even removed the duplicate logs and still the problem persists.

– Abhijeet Rastogi
Sep 21 '12 at 5:18













Which part did you remove? updated my answer.

– quanta
Sep 21 '12 at 6:48





Which part did you remove? updated my answer.

– quanta
Sep 21 '12 at 6:48

















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f430175%2flogrotate-deletes-all-maillogs-older-than-one-day%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos