Wednesday, 19 September 2012

Maximum Logrotate Compression with bzip2

A Tip for squeezing a little more free space from a VPS

KL Insight's Web Design VPS with Linode has been rock a solid solution over the last 4 years. It currently hosts multiple client sites and mail agent and all these sites and emails quickly eat up precious hard drive space; and with only 20GB the wall can be hit early.

The measly 20GB does comes with a kick ass IO rate that beats even some dedicated servers

Stop blabering and get to it

Linux logs everything, these logs grow overtime, systems run 'logrotate' to archive and delete old logs - the settings are very liberal and tweaking them could save gigabytes of space, 1.1GB in my instance. Modify your /etc/logrotate.conf as needed but the important bit is compressing by default and using bzip2 instead of gzip to do so.

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep x weeks worth of backlogs - default 4
rotate 2

# Archive log files by adding a YYYYMMDD instead of simply adding a number.
dateext

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

# uncomment this if you want your log files compressed
compress

# use bzip2 which is higher compression the gzip used by default
compresscmd /bin/bzip2
compressoptions -9
compressext .bz2
uncompresscmd /bin/bunzip2

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here

There are also specific application/services blog settings in the /etc/logrotate.d directory. Apache by default keeps it's logs for a lengthy 52 weeks! This can be changed by modifying the /etc/logrotate.d/apache2 file as shown below:

/var/log/apache2/*.log {
        weekly
        missingok
        # rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                /etc/init.d/apache2 reload > /dev/null
        endscript
}

Be legendary and do social like this post as that helps me immensely.

84 comments:

  1. Well thanks for posting such an outstanding idea. I like this blog & I like the topic and thinking of making it right.
    MICRO Economics Homework

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. Please keep them coming. Greets!!
    Matlab Assignment Experts

    ReplyDelete
  4. Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college
    Machinery Account Assignment Help

    ReplyDelete
  5. I personally like your post, you have shared good article. It will help me in great deal.
    Operations Research Assignments help

    ReplyDelete
  6. great post…. you have done great job….it very cool Dedicated Servers blog. linking is very useful thing you have really helped lots of people who visit this blog and provided them this useful information about server hosting.

    ReplyDelete
  7. I am so happy to read this. This is the kind of manual that needs to be given and not the random misinformation that's at the other blogs.
    Managing Up (B): Jada Case Solution

    ReplyDelete
  8. I totally agree that this peice of writing is really useful. It inspires me to find service to do my essay for me and do things that make life meaningful.

    ReplyDelete
  9. Forte schools offer a FREE trial Music Lessons Sydney and some offer Learn Piano, Guitar, Singing, Saxophone, Flute, Violin, Drums and More a Free Trial private lesson.

    ReplyDelete
  10. Wow, superb weblog layout! How lengthy have you been running a blog for? you make blogging look easy. The full look of your web site is wonderful, let alone the content material!

    Watch Risen (2016) Moive Online Watch The Witch Online

    ReplyDelete
  11. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again.
    Homework Help

    ReplyDelete
  12. I am very happy to read this. This is the kind of manual that needs to be given and not the random misinformation that’s at the other blogs. Appreciate your sharing this best posting.
    Assignment Help

    ReplyDelete
  13. I agree, many thanks to the author. Thanks for taking the time to share this,Great blog post.Thank you so much !

    Assignment help

    ReplyDelete
  14. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting.
    Assignment Help

    ReplyDelete
  15. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. . buy specs online

    ReplyDelete
  16. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting.
    Assignment Help

    ReplyDelete
  17. I enjoy a couple of from the Information which has been written, and particularly the comments posted I will definitely be visiting again.
    Assignment Help

    ReplyDelete
  18. I am certain this post has offered me some assistance with saving numerous hours of perusing other related presents just on find what I was searching for. Much obliged!
    Case Study Solution

    ReplyDelete
  19. However, there are grants that are made intended for equipment and training. free itunes gift card code generator

    ReplyDelete
  20. Electric Circuits online help- Electrical Project and Homework help - Electric circuits are the most characteristic structures in electrical engineering. As we shall use the term, a circuit is a collection of objects

    ReplyDelete
  21. All the best blogs that is very useful for keeping me share the ideas
    of the future as well this is really what I was looking for, and I am
    very happy to come here. Thank you very much
    earn to die
    earn to die 2
    earn to die 3
    Hi! I’ve been reading your blog for a while now and finally got the
    earn to die 4
    courage to go ahead and give youu a shout out from
    earn to die 6
    Austin Texas! Just wanted to tell
    earn to die 5
    Hi! I’ve been reading your blog for a while now and finally got the
    happy wheels
    strike force heroes
    slitherio
    you keep up the fantastic work!my weblog
    age of war
    good game empire

    ReplyDelete
  22. I cherished the way you talk about the point awesome work much obliged for the share Your useful post.
    Cynthia Carroll at Anglo American, Video Supplement Case Solution

    ReplyDelete
  23. I cherished the way you talk about the point awesome work much obliged for the share Your useful post.
    ASP Assignment Help

    ReplyDelete
    Replies
    1. I am completely agreed with you. This is a wonderful blog. Blog writer shared very useful and value able stuff. [url="http://www.stickerprinting.uk/Window-Stickers"]available window stickers uk[/url]

      Delete
  24. Once the reader sees a person as the expert you are, they will start to gain trust in an individual. gift card code generator

    ReplyDelete
  25. Goodness! It's wonderful to be sure! I am certain we can utilize numerous thoughts from this post for our assistance with exposition composing!
    Online Programming Homework Help

    ReplyDelete
  26. Amazing post! This is cleared that my whole confusion on short term loans. I thought that these loans have high interest rates.
    short term loans

    ReplyDelete
  27. Get details of National Cat Day 2016,know about Happy National Cat Day.Visit by blog and get surprises of Cat Day.

    ReplyDelete
  28. Great Information,it has lot for stuff which is informative.I will share the post with my friends.
    Finite Element Analysis Homework Help

    ReplyDelete
  29. My friend recommended this blog and he was totally right keep up the fantastic work!
    Accounting Dissertation Help

    ReplyDelete
  30. I'm getting excited about this kind of beneficial information of your stuff in the future
    help with programming homework

    ReplyDelete
  31. I want to thank you for this enlightening read, I really appreciate sharing this great post.packaging processing systems Keep up the good work.

    ReplyDelete
  32. This was a great and interesting article to read. I have really enjoyed all of this very cool information
    Application Layer Project Help

    ReplyDelete
  33. The leading assignment help UK firm offers state of the art services to its clients with a promise of delivering all the required work well within the deadline Chemistry online help

    ReplyDelete
  34. The leading assignment help UK firm offers state of the art services to its clients with a promise of delivering all the required work well within the deadline Chemistry online help

    ReplyDelete
  35. Want to know about Veterans Day? Why is it celebrated,how did it all start and all other details, just have a look at my blog, Happy Veterans Day Quotes

    and stay updated with all the latest information.

    ReplyDelete
  36. Visit pixel gun . Go to website to get more information.

    ReplyDelete
  37. That is fantastic blog, I will pas this to the other peoples.
    Stats Online Assignment Help

    ReplyDelete
  38. Thanks for such a great content on this website. 
    Online Physics Homework Help

    ReplyDelete
  39. i liked your point of view on this. i wanted to know you that i am a big fan of mobile game and i love to find latest game trick and tips. now a days i am playing pixel gun 3d game and i love it as this is a good shooting game, i am also finding the same pixel gun cheats if you know any pixel gun tips website then plaease refer me and will sure visit the site of pixel gun 3d guide. thanks and yes.. you are awesome.

    ReplyDelete
  40. http://news.chrisjordan.com/2013/03/new-interview.html

    ReplyDelete
  41. hi friend, it was worth reading your blog as this has changed my perspective about this topic. i am glad to read this post from you and will sure to hear more again from you about this. i am a big fan of madden nfl mobile game. i was looking for madden mobile coins over the net and still unable to found the reliable one. if you have any clue about madden mobile game, then please guide me to madden mobile tricks so that i can get them easily. thanks.

    ReplyDelete
  42. hi friend, i really loved your article on this topic. i was just amazed that you wrote this article very beutifully. i am a game lover and i love simcity buildit game very much. i know here lots of guys also love simcity buildit like me. i also tend to find simcity buildit free simcash but its too hard find it on internet. but i know i can manage simcity buildit cash easily very soon. one must play simcity buildit as this game improves your leadership skills.

    ReplyDelete
  43. Good website, Visit to know about xbox, xbox live 12 month free. Awesome innformation regarding xbox.Keep sharing

    ReplyDelete
  44. Thanks for such a great content on this website. 
    Homework Help Online

    ReplyDelete
  45. Those who come to read your article will find lots of helpful and informative tips
    Programming Matlab Help

    ReplyDelete
  46. for beginners like me need a lot of reading and searching for information on various blogs. and articles that you share a very nice and inspires me .
    cara menggugurkan kandungan
    obat aborsi
    kalkulator kehamilan

    ReplyDelete
  47. This is on the grounds that most understudy credits are ensured by government. For understudies, Student advances are a less expensive alternative than whatever other cash getting technique. Auto Title Loans

    ReplyDelete
  48. Terrible credit understudy advances are frequently accessible online at preferred rates of enthusiasm over what you would discover with customary loan specialists. These online moneylenders likewise have more capital, which implies they can credit cash to a greater number of borrowers than conventional banks can, and accordingly have a tendency to have the most astounding endorsement rates in the business. usapaydayloanstore.com/chicago

    ReplyDelete
  49. In the event that you are an understudy and attempting to back your reviews, benefit Personal Student Loans. Covering the vast majority of the costs of an understudy as for his instructive needs, understudy advances have set up themselves as an exceptionally well known device among understudies who try to concentrate enormous. Check Cashing

    ReplyDelete
  50. Frequently numerous understudies begin their vocation with advances hanging over their heads. By deciding on understudy credit obligation combination toward the end of their school life, these understudies can maintain a strategic distance from the threat of advances playing ruin with their fledging vocation. Check Cashing

    ReplyDelete
  51. There are a few sorts of understudy advance solidification arranges accessible relying upon who you loan it from. Cases are government understudy credit union, sallie mae understudy advance solidification and so on. Check with your school or loan specialist for more data. usacheckcashingstore.com/san-diego

    ReplyDelete
  52. Despite the fact that there are a couple of particular sorts of credits that will have a union expenses, none will request them forthright. When you are searching for your understudy credit solidification you will once in a while run over anything that requests expenses, since they marginally raise your loan fee to pay for it. aaa1autotitleloans.com/chicago

    ReplyDelete
  53. Brilliant post! The tips that you have shared with us are very useful. I really impressed to read the great post. Keep this great work up. local emergency plumber gainesville fl

    ReplyDelete
  54. good Other means to delight in Kodi on Raspberry Pi Kodi Download this has produced a shift of customers to SPMC nice.

    ReplyDelete
  55. good Remember this Apk is only for android versions. mobdro app The freemium version also presents advertisements nice.

    ReplyDelete
  56. good TELEVISION shows, motion pictures and also videos Mobdro.uk on your Windows display. Open up the app, best.

    ReplyDelete
  57. I am very happy to read this. Appreciate your sharing

    traffic rider |  tank trouble | atari breakout

    ReplyDelete
  58. good set up Kodi, set up various attachments and also databases Kodi APK you can take a look at some Kodi alternatives you could utilize. nice.

    ReplyDelete
  59. This is really a great stuff for sharing. Keep it up .Programming Project HelpThanks for sharing.

    ReplyDelete
  60. Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. marketing research writing Please keep them coming. Greets!!

    ReplyDelete
  61. Intensive research is dependably an unquestionable requirement in case you're anticipating applying for a payday advance. The principal payday advance you run over won't not be the best one. Payday Loans

    ReplyDelete
  62. You shouldn't hope to gain credits from respectable loan specialists through the telephone. An online accommodation of the application is the general strategy nowadays. After the application is affirmed, you can complete some other business by telephone. You will likewise have the capacity to contact the client benefit group via telephone with any inquiries you may have. Payday Loans

    ReplyDelete
  63. Our website is number 1 in Case Study assignment help, online Case Solution & Case Analysis experts. Feel free to contact us to get your case studies done.
    Case Study Assignment Help

    ReplyDelete
  64. It is very easy to finding us as we are at your city or nearest places. Just remember us and we will cash your check very short period with a very low cost. check cashing

    ReplyDelete
  65. We should acknowledge the obvious issues here - loan advances are not free. These organizations are ready to go to profit and profit they do, for the most part charging an expense beginning at around 25% by and large. Payday Loans Chula-vista

    ReplyDelete
  66. This is on account of there are currently a few moneylenders who offer loans to unemployed individuals. Cash Advance

    ReplyDelete
  67. When you take California auto title advances from an offensive moneylender, it can trap you in a cycle of obligation that is difficult to escape.
    Car Title Loans

    ReplyDelete
  68. In spite of the fact that you are not required to post insurance, you are required to reimburse your advance on time. By taking out a Second Risk Payday Loan you are consenting to reimburse your fleeting credit upon the receipt of your next paycheck. It is imperative to obtain dependably; don't get more than you can bear to return on payday. Check Cashing

    ReplyDelete
  69. . we tend to really like to oblige you the most effective things with 100 percent agreements and quicker ever.
    check casher Edison

    ReplyDelete
  70. You could even share your location with pals to understand them where you are. WhatsApp for PC Download Mac & Windows 10/8.1/7 Desktop How to utilize Whatsapp internet version.

    ReplyDelete
    Replies
    1. Free PhP, Java, Ruby on Rails tutorials – Freelaphp

      Delete
  71. You would now be able to go on the web and have the capacity to apply for an advance and never expecting to fax anything. This would be the no faxing payday advances. Payday Loans San-diego

    ReplyDelete
  72. A money related crisis additionally has comparable necessities, wherein, you require prompt assets to meet the dire prerequisite that has sprung up.Cash Advance

    ReplyDelete
  73. For swift and hassle free short term installment loans UK , contact Best Unsecured Loans. We are loan brokers who abide by all FCA guidelines and ensure safe and secure loans for people with bad or no credit history. We search for tailored installment loans for UK people.

    ReplyDelete