logrotate status files extremely largeWhy do JBoss and Logrotate create log files full of NUL characters?Logrotate Mysql - No rotate happensLogrotate Successful, original file goes back to original sizelogrotate not deleting old files - glob failingHow does logrotate interact with hard linked files?Making logrotate remove old logs after reducing 'rotate' valueLogrotate not rotating logs on AWS LinuxLogrotate Not Deleting Compressed LogsLogrotate Separate Policies in Same Directory

How to use dependency injection and avoid temporal coupling?

Adjacent DEM color matching in QGIS

Building a list of products from the elements in another list

Is there an idiom that support the idea that "inflation is bad"?

What is a smasher?

My advisor talks about me to his colleague

How should I tell my manager I'm not paying for an optional after work event I'm not going to?

Why do people keep telling me that I am a bad photographer?

What are the differences between credential stuffing and password spraying?

Where is the documentation for this ex command?

What is the solution to this metapuzzle from a university puzzling column?

Find the cheapest shipping option based on item weight

Pressure inside an infinite ocean?

Word meaning as function of the composition of its phonemes

In Russian, how do you idiomatically express the idea of the figurative "overnight"?

Are the Night's Watch still required?

Should I mention being denied entry to UK due to a confusion in my Visa and Ticket bookings?

Nominativ or Akkusativ

29er Road Tire?

Wrong answer from DSolve when solving a differential equation

Word for Food that's Gone 'Bad', but is Still Edible?

Why does sound not move through a wall?

Does the 7th major scale note resolve more strongly to the lower tonic (note 1) than the higher tonic (note 8)?

PWM 1Hz on solid state relay



logrotate status files extremely large


Why do JBoss and Logrotate create log files full of NUL characters?Logrotate Mysql - No rotate happensLogrotate Successful, original file goes back to original sizelogrotate not deleting old files - glob failingHow does logrotate interact with hard linked files?Making logrotate remove old logs after reducing 'rotate' valueLogrotate not rotating logs on AWS LinuxLogrotate Not Deleting Compressed LogsLogrotate Separate Policies in Same Directory






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/.



logrotate has files in there which are called /var/lib/logrotate/status and /var/lib/logrotate/status.clean and taking up a lot of space... 30gb and 60gb.



I'm aware that logrotate is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*.



(/var/lib/logrotate/status has repopulated with new logs from rotate processes throughout the day)



Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?










share|improve this question






























    1















    Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/.



    logrotate has files in there which are called /var/lib/logrotate/status and /var/lib/logrotate/status.clean and taking up a lot of space... 30gb and 60gb.



    I'm aware that logrotate is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*.



    (/var/lib/logrotate/status has repopulated with new logs from rotate processes throughout the day)



    Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?










    share|improve this question


























      1












      1








      1


      1






      Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/.



      logrotate has files in there which are called /var/lib/logrotate/status and /var/lib/logrotate/status.clean and taking up a lot of space... 30gb and 60gb.



      I'm aware that logrotate is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*.



      (/var/lib/logrotate/status has repopulated with new logs from rotate processes throughout the day)



      Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?










      share|improve this question
















      Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/lib/logrotate/.



      logrotate has files in there which are called /var/lib/logrotate/status and /var/lib/logrotate/status.clean and taking up a lot of space... 30gb and 60gb.



      I'm aware that logrotate is used to regularly clear log files but it seems that it doesn't clear it's own 'log' files by default. I resolved the disk space issue by deleting the two files in there rm -rf /var/lib/logrotate/*.



      (/var/lib/logrotate/status has repopulated with new logs from rotate processes throughout the day)



      Is this something that is going to keep happening if logrotate doesn't rotate it's own logs?







      logging ubuntu-16.04 logrotate du log-rotation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 19 '17 at 1:16







      Angelo

















      asked Dec 18 '17 at 21:44









      AngeloAngelo

      63




      63




















          2 Answers
          2






          active

          oldest

          votes


















          0














          You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.



          To setup a weekly cron job that resets the logrotate.status file:



          1. open cron crontab -e

          2. add the entry * * * * 1 echo > /var/lib/logrotate.status

          To setup rotation of the file every week:
          Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.



          Example Script:



          #!/bin/bash
          /bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
          /bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
          /bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
          /bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1


          To set the script's file permissions:



          chmod u+x [script-filename]


          Cron task format:



          * * * * 1 /full/path/to/your/script





          share|improve this answer

























          • the order of mv commands in your script sample looks funny. i think you meant something different.

            – anx
            Dec 19 '17 at 5:13











          • you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

            – Anson W Han
            Dec 19 '17 at 5:16












          • This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

            – Angelo
            Dec 19 '17 at 14:29












          • This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

            – Richlv
            Sep 12 '18 at 6:17


















          0














          Deleting or rotating the logrotate.status file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status file that large?"



          I would tail -n 500 that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.






          share|improve this answer























            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%2f888757%2flogrotate-status-files-extremely-large%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.



            To setup a weekly cron job that resets the logrotate.status file:



            1. open cron crontab -e

            2. add the entry * * * * 1 echo > /var/lib/logrotate.status

            To setup rotation of the file every week:
            Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.



            Example Script:



            #!/bin/bash
            /bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
            /bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
            /bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
            /bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1


            To set the script's file permissions:



            chmod u+x [script-filename]


            Cron task format:



            * * * * 1 /full/path/to/your/script





            share|improve this answer

























            • the order of mv commands in your script sample looks funny. i think you meant something different.

              – anx
              Dec 19 '17 at 5:13











            • you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

              – Anson W Han
              Dec 19 '17 at 5:16












            • This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

              – Angelo
              Dec 19 '17 at 14:29












            • This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

              – Richlv
              Sep 12 '18 at 6:17















            0














            You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.



            To setup a weekly cron job that resets the logrotate.status file:



            1. open cron crontab -e

            2. add the entry * * * * 1 echo > /var/lib/logrotate.status

            To setup rotation of the file every week:
            Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.



            Example Script:



            #!/bin/bash
            /bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
            /bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
            /bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
            /bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1


            To set the script's file permissions:



            chmod u+x [script-filename]


            Cron task format:



            * * * * 1 /full/path/to/your/script





            share|improve this answer

























            • the order of mv commands in your script sample looks funny. i think you meant something different.

              – anx
              Dec 19 '17 at 5:13











            • you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

              – Anson W Han
              Dec 19 '17 at 5:16












            • This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

              – Angelo
              Dec 19 '17 at 14:29












            • This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

              – Richlv
              Sep 12 '18 at 6:17













            0












            0








            0







            You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.



            To setup a weekly cron job that resets the logrotate.status file:



            1. open cron crontab -e

            2. add the entry * * * * 1 echo > /var/lib/logrotate.status

            To setup rotation of the file every week:
            Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.



            Example Script:



            #!/bin/bash
            /bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
            /bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
            /bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
            /bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1


            To set the script's file permissions:



            chmod u+x [script-filename]


            Cron task format:



            * * * * 1 /full/path/to/your/script





            share|improve this answer















            You can setup a cron job to either clean up or rotate/truncate the logrotate.status file on a routine basis. I'd recommend a weekly one if your server volume is moderate, daily if extremely heavy traffic.



            To setup a weekly cron job that resets the logrotate.status file:



            1. open cron crontab -e

            2. add the entry * * * * 1 echo > /var/lib/logrotate.status

            To setup rotation of the file every week:
            Create a script (make sure it's executable by the cron user) and run a weekly cron to call the it.



            Example Script:



            #!/bin/bash
            /bin/mv /var/lib/logrotate.status.3 /var/lib/logrotate.status.4
            /bin/mv /var/lib/logrotate.status.2 /var/lib/logrotate.status.3
            /bin/mv /var/lib/logrotate.status.1 /var/lib/logrotate.status.2
            /bin/mv /var/lib/logrotate.status /var/lib/logrotate.status.1


            To set the script's file permissions:



            chmod u+x [script-filename]


            Cron task format:



            * * * * 1 /full/path/to/your/script






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 19 '17 at 5:16

























            answered Dec 19 '17 at 4:38









            Anson W HanAnson W Han

            36616




            36616












            • the order of mv commands in your script sample looks funny. i think you meant something different.

              – anx
              Dec 19 '17 at 5:13











            • you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

              – Anson W Han
              Dec 19 '17 at 5:16












            • This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

              – Angelo
              Dec 19 '17 at 14:29












            • This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

              – Richlv
              Sep 12 '18 at 6:17

















            • the order of mv commands in your script sample looks funny. i think you meant something different.

              – anx
              Dec 19 '17 at 5:13











            • you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

              – Anson W Han
              Dec 19 '17 at 5:16












            • This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

              – Angelo
              Dec 19 '17 at 14:29












            • This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

              – Richlv
              Sep 12 '18 at 6:17
















            the order of mv commands in your script sample looks funny. i think you meant something different.

            – anx
            Dec 19 '17 at 5:13





            the order of mv commands in your script sample looks funny. i think you meant something different.

            – anx
            Dec 19 '17 at 5:13













            you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

            – Anson W Han
            Dec 19 '17 at 5:16






            you're right, it's backwards. It should be rotate oldest first, newest last. My bad- edited to refect proper order.

            – Anson W Han
            Dec 19 '17 at 5:16














            This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

            – Angelo
            Dec 19 '17 at 14:29






            This line will cause issues with all logrotate processes... echo > /var/lib/logrotate.status. This answer is very similar with what is found here however it is not a solution. (The echo command will leave a blank line in the file thus corrupting the file and stopping logs from rotating)

            – Angelo
            Dec 19 '17 at 14:29














            This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

            – Richlv
            Sep 12 '18 at 6:17





            This does not seem to be a solution. One should look into why the files are so huge, possibly there are wrong patterns in the configuration.

            – Richlv
            Sep 12 '18 at 6:17













            0














            Deleting or rotating the logrotate.status file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status file that large?"



            I would tail -n 500 that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.






            share|improve this answer



























              0














              Deleting or rotating the logrotate.status file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status file that large?"



              I would tail -n 500 that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.






              share|improve this answer

























                0












                0








                0







                Deleting or rotating the logrotate.status file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status file that large?"



                I would tail -n 500 that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.






                share|improve this answer













                Deleting or rotating the logrotate.status file is only a band-aid. You need to take a step backward and ask the question, "why is the logrotate.status file that large?"



                I would tail -n 500 that status file and see what files are listed in there. I think there's a real strong possibility that your logrotate config file(s) are rotating stuff you never intended to be rotated.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 25 at 3:04









                user3629081user3629081

                1062




                1062



























                    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%2f888757%2flogrotate-status-files-extremely-large%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

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company