Logs gzipped and not gzipped

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Recently I've changed logs configuration for letsencrypt, because there was no given one and I have files:



letsencrypt.log
letsencrypt.log.1
letsencrypt.log.10
letsencrypt.log.10.gz
letsencrypt.log.11
letsencrypt.log.11.gz
letsencrypt.log.12
letsencrypt.log.12.gz
letsencrypt.log.13
letsencrypt.log.13.gz
letsencrypt.log.14
letsencrypt.log.14.gz
letsencrypt.log.15
letsencrypt.log.15.gz
letsencrypt.log.16
letsencrypt.log.16.gz


where even files have 1409 bytes and odd files have 0 bytes. Gzipped files however have some content (which differs). The configuration for log rotate is:



/var/log/letsencrypt/*.log 
daily
rotate 32
compress
delaycompress
missingok
notifempty
create 644 root root



How should I change the log rotate configuration to leave only:



  1. first two files not gzipped,

  2. rest of the files gzipped,

  3. get rid of empty files?









share|improve this question





















  • Do you have two sets of cron jobs running tho log rotation?
    – Kusalananda
    Dec 8 at 10:17










  • @Kusalananda No, surely not.
    – pbies
    Dec 8 at 10:22






  • 2




    @Kusalananda When you keep changing the log rotation scheme, either you have to rename or backup/delete logs. The old dangling names wont delete themselves alone.
    – Rui F Ribeiro
    Dec 8 at 10:46










  • Yes, I had made experiments changing the log rotate configuration but each time I've removed all the logs. No success yet.
    – pbies
    Dec 8 at 10:50










  • @RuiFRibeiro I don't think your comment was for me, was it?
    – Kusalananda
    Dec 8 at 12:16














up vote
1
down vote

favorite












Recently I've changed logs configuration for letsencrypt, because there was no given one and I have files:



letsencrypt.log
letsencrypt.log.1
letsencrypt.log.10
letsencrypt.log.10.gz
letsencrypt.log.11
letsencrypt.log.11.gz
letsencrypt.log.12
letsencrypt.log.12.gz
letsencrypt.log.13
letsencrypt.log.13.gz
letsencrypt.log.14
letsencrypt.log.14.gz
letsencrypt.log.15
letsencrypt.log.15.gz
letsencrypt.log.16
letsencrypt.log.16.gz


where even files have 1409 bytes and odd files have 0 bytes. Gzipped files however have some content (which differs). The configuration for log rotate is:



/var/log/letsencrypt/*.log 
daily
rotate 32
compress
delaycompress
missingok
notifempty
create 644 root root



How should I change the log rotate configuration to leave only:



  1. first two files not gzipped,

  2. rest of the files gzipped,

  3. get rid of empty files?









share|improve this question





















  • Do you have two sets of cron jobs running tho log rotation?
    – Kusalananda
    Dec 8 at 10:17










  • @Kusalananda No, surely not.
    – pbies
    Dec 8 at 10:22






  • 2




    @Kusalananda When you keep changing the log rotation scheme, either you have to rename or backup/delete logs. The old dangling names wont delete themselves alone.
    – Rui F Ribeiro
    Dec 8 at 10:46










  • Yes, I had made experiments changing the log rotate configuration but each time I've removed all the logs. No success yet.
    – pbies
    Dec 8 at 10:50










  • @RuiFRibeiro I don't think your comment was for me, was it?
    – Kusalananda
    Dec 8 at 12:16












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Recently I've changed logs configuration for letsencrypt, because there was no given one and I have files:



letsencrypt.log
letsencrypt.log.1
letsencrypt.log.10
letsencrypt.log.10.gz
letsencrypt.log.11
letsencrypt.log.11.gz
letsencrypt.log.12
letsencrypt.log.12.gz
letsencrypt.log.13
letsencrypt.log.13.gz
letsencrypt.log.14
letsencrypt.log.14.gz
letsencrypt.log.15
letsencrypt.log.15.gz
letsencrypt.log.16
letsencrypt.log.16.gz


where even files have 1409 bytes and odd files have 0 bytes. Gzipped files however have some content (which differs). The configuration for log rotate is:



/var/log/letsencrypt/*.log 
daily
rotate 32
compress
delaycompress
missingok
notifempty
create 644 root root



How should I change the log rotate configuration to leave only:



  1. first two files not gzipped,

  2. rest of the files gzipped,

  3. get rid of empty files?









share|improve this question













Recently I've changed logs configuration for letsencrypt, because there was no given one and I have files:



letsencrypt.log
letsencrypt.log.1
letsencrypt.log.10
letsencrypt.log.10.gz
letsencrypt.log.11
letsencrypt.log.11.gz
letsencrypt.log.12
letsencrypt.log.12.gz
letsencrypt.log.13
letsencrypt.log.13.gz
letsencrypt.log.14
letsencrypt.log.14.gz
letsencrypt.log.15
letsencrypt.log.15.gz
letsencrypt.log.16
letsencrypt.log.16.gz


where even files have 1409 bytes and odd files have 0 bytes. Gzipped files however have some content (which differs). The configuration for log rotate is:



/var/log/letsencrypt/*.log 
daily
rotate 32
compress
delaycompress
missingok
notifempty
create 644 root root



How should I change the log rotate configuration to leave only:



  1. first two files not gzipped,

  2. rest of the files gzipped,

  3. get rid of empty files?






linux logs gzip logrotate letsencrypt






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 8 at 10:13









pbies

15110




15110











  • Do you have two sets of cron jobs running tho log rotation?
    – Kusalananda
    Dec 8 at 10:17










  • @Kusalananda No, surely not.
    – pbies
    Dec 8 at 10:22






  • 2




    @Kusalananda When you keep changing the log rotation scheme, either you have to rename or backup/delete logs. The old dangling names wont delete themselves alone.
    – Rui F Ribeiro
    Dec 8 at 10:46










  • Yes, I had made experiments changing the log rotate configuration but each time I've removed all the logs. No success yet.
    – pbies
    Dec 8 at 10:50










  • @RuiFRibeiro I don't think your comment was for me, was it?
    – Kusalananda
    Dec 8 at 12:16
















  • Do you have two sets of cron jobs running tho log rotation?
    – Kusalananda
    Dec 8 at 10:17










  • @Kusalananda No, surely not.
    – pbies
    Dec 8 at 10:22






  • 2




    @Kusalananda When you keep changing the log rotation scheme, either you have to rename or backup/delete logs. The old dangling names wont delete themselves alone.
    – Rui F Ribeiro
    Dec 8 at 10:46










  • Yes, I had made experiments changing the log rotate configuration but each time I've removed all the logs. No success yet.
    – pbies
    Dec 8 at 10:50










  • @RuiFRibeiro I don't think your comment was for me, was it?
    – Kusalananda
    Dec 8 at 12:16















Do you have two sets of cron jobs running tho log rotation?
– Kusalananda
Dec 8 at 10:17




Do you have two sets of cron jobs running tho log rotation?
– Kusalananda
Dec 8 at 10:17












@Kusalananda No, surely not.
– pbies
Dec 8 at 10:22




@Kusalananda No, surely not.
– pbies
Dec 8 at 10:22




2




2




@Kusalananda When you keep changing the log rotation scheme, either you have to rename or backup/delete logs. The old dangling names wont delete themselves alone.
– Rui F Ribeiro
Dec 8 at 10:46




@Kusalananda When you keep changing the log rotation scheme, either you have to rename or backup/delete logs. The old dangling names wont delete themselves alone.
– Rui F Ribeiro
Dec 8 at 10:46












Yes, I had made experiments changing the log rotate configuration but each time I've removed all the logs. No success yet.
– pbies
Dec 8 at 10:50




Yes, I had made experiments changing the log rotate configuration but each time I've removed all the logs. No success yet.
– pbies
Dec 8 at 10:50












@RuiFRibeiro I don't think your comment was for me, was it?
– Kusalananda
Dec 8 at 12:16




@RuiFRibeiro I don't think your comment was for me, was it?
– Kusalananda
Dec 8 at 12:16










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Ok, so I've managed to make proper log rotate:



/var/log/letsencrypt/*.log 
weekly
rotate 9
compress
delaycompress
missingok
create 644 root root



So the difference is that I've removed notifempty.






share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f486744%2flogs-gzipped-and-not-gzipped%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








    up vote
    0
    down vote



    accepted










    Ok, so I've managed to make proper log rotate:



    /var/log/letsencrypt/*.log 
    weekly
    rotate 9
    compress
    delaycompress
    missingok
    create 644 root root



    So the difference is that I've removed notifempty.






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      Ok, so I've managed to make proper log rotate:



      /var/log/letsencrypt/*.log 
      weekly
      rotate 9
      compress
      delaycompress
      missingok
      create 644 root root



      So the difference is that I've removed notifempty.






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Ok, so I've managed to make proper log rotate:



        /var/log/letsencrypt/*.log 
        weekly
        rotate 9
        compress
        delaycompress
        missingok
        create 644 root root



        So the difference is that I've removed notifempty.






        share|improve this answer












        Ok, so I've managed to make proper log rotate:



        /var/log/letsencrypt/*.log 
        weekly
        rotate 9
        compress
        delaycompress
        missingok
        create 644 root root



        So the difference is that I've removed notifempty.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 12 at 12:55









        pbies

        15110




        15110



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2funix.stackexchange.com%2fquestions%2f486744%2flogs-gzipped-and-not-gzipped%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 check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay