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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-03-2006, 11:29 AM
|
#1
|
Member
Registered: Mar 2003
Posts: 123
Rep:
|
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 11:48 AM.
|
|
|
01-03-2006, 12:16 PM
|
#2
|
Member
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519
Rep:
|
I don't see why you shouldn't delete anything you like. 
|
|
|
01-03-2006, 12:23 PM
|
#3
|
LQ Newbie
Registered: Oct 2005
Distribution: Slackware
Posts: 4
Rep:
|
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.
|
|
|
01-03-2006, 01:01 PM
|
#4
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
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.
|
|
|
01-03-2006, 01:09 PM
|
#5
|
Member
Registered: Feb 2003
Location: O.C., CA
Distribution: Kubuntu
Posts: 70
Rep:
|
and as soon as your get your /var partition cleaned up you should look into using logrotate to keep those log files under control 
|
|
|
All times are GMT -5. The time now is 03:12 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|