Skip to content

Blog of Debashish

  • About
  • Privacy Policy
  • Who am I?

Deleting Logs on Web-Server to free up diskspace

Posted on October 20, 2018February 3, 2020 by Debashish

First rotate the logs, using the following command.

sudo /etc/cron.daily/logrotate

This should rotate the log files (so kern.log becomes kern.log.1); and you can then delete kern.log.1 etc to free up the disk space.

Then delete the old log files.

sudo find /var/log -type f -name "*.1" -delete

If thewre are too many old archived log files, delete them as well.

sudo find /var/log -type f -name "*.gz" -delete

Check Journalctl Logs

journalctl --disk-usage

Vacuum Logs older than a few days
journalctl --vacuum-time=2d

or Vacuum Logs keeping the minimum size

journalctl --vacuum-size=500M

You can control the size of this directory using this parameter in your /etc/systemd/journald.conf:

SystemMaxUse=50M

Posted in Web Design and Maintenance Tips

Post navigation

Previous PostAwesome Electronics – A curated list of awesome resources for electronic engineers and hobbyists
Next PostMy Experience with various Cloud VPS ( and their Performance tests)

Awesome Mass Effect Quotes


Loading Quotes...

Get In Touch

Email: admin <at> debashish.info

 

Search

Recent Posts

  • Cleaning up MySQL Logs December 3, 2021
  • Why a Driver is needed to interface a DC/Stepper Motor with a Microcontroller December 30, 2020
  • Tips – Make separate Archives for each folder August 31, 2020
  • Some Tips for Using Anaconda Python August 8, 2020
  • What is MPPT? June 26, 2020

Old Posts

  • December 2021 (1)
  • December 2020 (1)
  • August 2020 (2)
  • June 2020 (1)
  • October 2019 (2)
  • October 2018 (4)
  • September 2018 (6)

About This Site

Hi there. I am Debashish Mohapatra. This is my blog site. I like to occasionally write about any important(or not) findings i come across. Let this site be an attempt in recording such stories.

Find Us

Address
123 Main Street
New York, NY 10001

Hours
Monday—Friday: 9:00AM–5:00PM
Saturday & Sunday: 11:00AM–3:00PM

About This Site

This may be a good place to introduce yourself and your site or include some credits.

Search

Powered by Headline WordPress Theme