Results 1 to 7 of 7

Thread: [SOLVED] deleting log files

  1. #1
    Join Date
    Dec 2007
    Location
    San Antonio Texas
    Beans
    454

    [SOLVED] deleting log files

    ok, here's the deal. i'm currently working with minimal HDD space (a little under 50 GB), so i'm always looking for ways to free up space. so i started poking around and i'm wondering if it's safe to delete everything in /var/log, and if not, what IS safe to delete. also, any other suggestions on safely freeing up HDD space is greatly appreciated. so far i know of these commands:

    Code:
    sudo apt-get autoremove
    sudo apt-get autoclean
    much thanks in advance,

    Phil

  2. #2
    Join Date
    Mar 2006
    Location
    Denmark - Copenhagen
    Beans
    2,165

    Re: deleting log files

    Also try:
    Code:
    sudo apt-get clean
    Which clears apts cache entirely.

    Also look here how to free space.. logfiles are text files and does not require much space.

    http://www.ubuntugeek.com/cleaning-u...in-ubuntu.html

  3. #3
    Join Date
    May 2007
    Beans
    1,342
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: deleting log files

    Quote Originally Posted by rockerphil View Post
    ok, here's the deal. i'm currently working with minimal HDD space (a little under 50 GB), so i'm always looking for ways to free up space. so i started poking around and i'm wondering if it's safe to delete everything in /var/log, and if not, what IS safe to delete. also, any other suggestions on safely freeing up HDD space is greatly appreciated. so far i know of these commands:

    Code:
    sudo apt-get autoremove
    sudo apt-get autoclean
    much thanks in advance,

    Phil
    First, I'd be surprised to see you free up as much as 2 GB of space from dumping logfiles.
    Second, if you insist on doing this, be aware that many of the files in question are system files, and as such are owned by root. This means invoking the hazardous rm command with root privileges.

    Personally, I'd look into log rotation or some other option to keep the size down.

    Or better yet, install /var on it's own (smallish) partition, like the real sysadmins do...
    eeeeeeeeeeeeeeeebuntu user!
    Registered Linux User #386750

    chown -R us base

  4. #4
    Join Date
    Jan 2007
    Beans
    169

    Re: deleting log files

    Quote Originally Posted by handydan918 View Post
    First, I'd be surprised to see you free up as much as 2 GB of space from dumping logfiles.
    Second, if you insist on doing this, be aware that many of the files in question are system files, and as such are owned by root. This means invoking the hazardous rm command with root privileges.

    Personally, I'd look into log rotation or some other option to keep the size down.

    Or better yet, install /var on it's own (smallish) partition, like the real sysadmins do...
    i need some small 100mb to do the system update on a netbook with SSDs (hell will freeze before i waste even 10mb for a var partition

    even after aptitude autoclean i still have 30M on /var/cache/apt and 40M on /var/logs

  5. #5
    Join Date
    Jan 2007
    Beans
    169

    Re: deleting log files

    Quote Originally Posted by handydan918 View Post
    First, I'd be surprised to see you free up as much as 2 GB of space from dumping logfiles.
    Second, if you insist on doing this, be aware that many of the files in question are system files, and as such are owned by root. This means invoking the hazardous rm command with root privileges.

    Personally, I'd look into log rotation or some other option to keep the size down.

    Or better yet, install /var on it's own (smallish) partition, like the real sysadmins do...
    i need some small 100mb to do the system update on a netbook with SSDs (hell will freeze before i waste even 10mb for a var partition

    even after aptitude autoclean i still have 30M on /var/cache/apt and 40M on /var/logs


    Anyway, what i got away with was:

    sudo aptitude remove --purge 2.6.31-10\*
    Got 689Mb freed by this.

    it will remove all the 2.6.31.1[0-9] packages that you have lying around (i'm still unsure why aptitude treats 0* as .* in it's regexp)

    Just make sure you are not using any of those kernels

    uname -r will show you the current one. i'm on .22 and left .20 and .21 there too.

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!

    Re: deleting log files

    Quote Originally Posted by gcbzzzz
    i need some small 100mb to do the system update on a netbook with SSDs (hell will freeze before i waste even 10mb for a var partition

    even after aptitude autoclean i still have 30M on /var/cache/apt and 40M on /var/logs
    autoclean deletes only the ones that are no longer available for download.

    clean deletes all the packages in the cache.

    If I found 40MB of files in my /var/log, rather than wanting to delete them, I would want to investigate what was dropping all the errors. But, you may do as you choose.

  7. #7
    Join Date
    Jul 2008
    Location
    Woodstock Cape Town RSA
    Beans
    1,030
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: deleting log files

    i have 158M sitting in /var/mail

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •