How to Setup and Manage Log Rotation Using Logrotate in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Linux BASH Programming Cookbook
Getting Started with Ubuntu 16.04
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

4 Responses

  1. fatboy92 says:

    Hi all,

    What about cases where the outdoor is never close. I had that case, it meant that the file ran full, i.e. the file system ran full, the file however showed only a small.size. A real problem when you don’t know. The file system says it’s full, but the sum of all file sizes is much smaller than the file system.

  2. Ravikumar says:

    How to rotate logs manually. If I want to rotate the log files now, what to do?

    • Gabriel A. Cánepa says:

      As explained in this very article, you can rotate the logs by using the same command as in the dry-run – just omit the -d option. Assuming you want to process the /var/log/squid/access.log file, do:
      logrotate /etc/logrotate.d/squid.conf

    • gasmyr says:

      logrotate -f myConfig_file, have a look in man page of logrotate(man logrotate)

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?