LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-03-2006, 12:29 PM   #1
Tenover
Member
 
Registered: Mar 2003
Posts: 123

Rep: Reputation: 15
Can I delete all logs in /var/log? HURRY!


My /var partition is at 100%! I have tons of logs that are taking up tons of space...Can I simply delete them, and will they just be recreated as needed by whatever application needs them (cron, backup, etc...?)? Thanks.

Last edited by Tenover; 01-03-2006 at 12:48 PM.
 
Old 01-03-2006, 01:16 PM   #2
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
I don't see why you shouldn't delete anything you like.
 
Old 01-03-2006, 01:23 PM   #3
Linc
LQ Newbie
 
Registered: Oct 2005
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by Tenover
My /var partition is at 100%! I have tons of logs that are taking up tons of space...Can I simply delete them, and will they just be recreated as needed by whatever application needs them (cron, backup, etc...?)? Thanks.
as root:
for file in /var/log; do > $file; done

This will truncate them for you.
 
Old 01-03-2006, 02:01 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,274

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by Tenover
My /var partition is at 100%! I have tons of logs that are taking up tons of space...Can I simply delete them, and will they just be recreated as needed by whatever application needs them (cron, backup, etc...?)? Thanks.
It's safe to delete all the old logs that probably end in .gz or maybe .bz2 I'd hang on to the current logs unless you're really that tight on space.

Depending on your distribution, you may have a bunch of mostly useless stuff under /var. apt-get from Debian stores stuff there (that can easily be recreated). Under Debian, run "apt-get clean" to free up some space under /var. I imagine any distro that uses apt-get uses /var for the temp storage, but that's just a guess.
 
Old 01-03-2006, 02:09 PM   #5
nouse66
Member
 
Registered: Feb 2003
Location: O.C., CA
Distribution: Kubuntu
Posts: 70

Rep: Reputation: 15
and as soon as your get your /var partition cleaned up you should look into using logrotate to keep those log files under control
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 05:03 PM
VAR - logs - when to delete High-gain Linux - Newbie 4 02-27-2005 10:54 AM
Strange results in /var/log/apache/access.log subt13 Linux - Security 2 08-03-2004 02:21 PM
strange logs in /var/log/messages dominant Linux - Security 1 04-21-2004 01:12 PM
pppd logging to /var/log/ppp.log problem mrtwice Linux - Software 1 01-10-2004 06:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:08 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration