LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-23-2011, 12:10 PM   #1
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
Cool Log files - safe to delete?


Hi,

Okay, I admit: this may be a noob question, but, I want to make sure, so here goes.

I"ve sniffed on the hard drive (yea' I know, I need a hobby ) and found I plunged from 1.4Gb to ... 520Mb worth of filesystem space . What gives? I've got ... 670Mb worth of log files . Now, I know (duh) I can just delete the stuff, but (here's the reason of my question) is'nt there a more elegant way to do this? A util to clean out logs or something?

Thanks and festive greetings

Thor
 
Old 12-23-2011, 12:20 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,544
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
logrotate is the standard way to housekeep log files
 
1 members found this post helpful.
Old 12-23-2011, 12:24 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,500

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
You can use logrotate.
You can specify the size before rotating, run a script to delete the rotated logfiles etc.
http://www.thegeekstuff.com/2010/07/logrotate-examples/

Kind regards
 
1 members found this post helpful.
Old 12-23-2011, 01:12 PM   #4
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
Thanks to both of you! I'll dive right into the man pages and get the place cleaned up!

Thor
 
Old 12-24-2011, 02:55 AM   #5
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
Addendum:

For anyone with the same log file issues as I had, the logrotate comand is the best way around (as suggested here by some wiser ones ) so a complete command as follows should do, exec as Root:
Quote:
logrotate -f -v /etc/logrotate.conf
Assuming your logrotate.conf is in /etc, of course.

Just to help out and shorten someone's search!

Festive greetings!

Thor

Last edited by Thor_2.0; 12-24-2011 at 02:56 AM.
 
Old 12-24-2011, 05:09 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,544
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Most (?) distros run logrotate daily via cron or anacron and the /etc/cron.daily/logrotate file.
 
Old 12-24-2011, 07:47 AM   #7
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: Mepis; Maemo; openSUSE
Posts: 384
Blog Entries: 74

Rep: Reputation: 81
Personally, I use bleachbit run as root.
 
Old 12-24-2011, 11:41 AM   #8
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
@catkin - indeed, logrotate is a dayly event here too, but...I panic quickly and then I need to resolve things quickly, so hence the tip above...
@rich c - bleachbit? Never heared of that, thanks, lemme look into that
 
  


Reply

Tags
cleanup, diskspace, log


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete all .log files and .bat files except the most recent? alancampbell6 Linux - Newbie 3 12-15-2011 09:17 AM
[SOLVED] Can I delete /var/log/removed_package files ? argentux Slackware 9 06-18-2011 01:49 AM
Which files are safe to delete? zoomzilla Linux - Newbie 6 11-26-2009 06:39 AM
Best way to delete old unwanted log files?? xmdms Linux - Newbie 6 10-27-2008 09:36 AM
Delete Log Files raysr Mandriva 2 01-31-2006 11:15 AM


All times are GMT -5. The time now is 09:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration