Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member ullalla's Avatar
    Join Date
    Jan 2006
    Posts
    192

    Default /var getting full

    It will be great if everyone put the ideas to empty the /var partition on cpanel server as its getting full again and again. Though I have tried few of them but need to know if there is anything else we can do?

    What I do :

    1) take the backup of importatn logs file in /var/log and empty them.
    2) checked for databases at /var/lib/mysql and removed unnecessary(which are not in use)
    3) I emptied /var/lib/slocate/slocate.db (is it good idea to do so ?)

  2. #2
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default

    3) I emptied /var/lib/slocate/slocate.db (is it good idea to do so ?)
    /var/lib/slocate/slocate.db is used by the locate command. locate lets you search for files without making the operating system examine each and every file (which the find command does, and it can be very slow). Instead, it searches a database that is maintained by the updatedb command. Deleting slocate.db will break the locate command, but it will not affect anything else.

    If you want the locate command to work, you can regenerate the database using these commands:

    Code:
    # touch /var/lib/slocate/slocate.db
    # updatedb
    It may take some time for the updatedb command to finish, depending on the size of the filesystems, how many files are on them, and how deep subdirectories are nested.
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

  3. #3
    Member ullalla's Avatar
    Join Date
    Jan 2006
    Posts
    192

    Default

    Thanks for having look into this.

    But is there any other files that we can empty in order to get some disk space free ?

  4. #4
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by ullalla View Post
    Thanks for having look into this.

    But is there any other files that we can empty in order to get some disk space free ?
    What size is the drive or partition for "/var"? I ask because you may need to consider using a larger drive and or larger partition size when considering future growth and accounting for the natural increase of data being stored.

    Use the following commands as an example to obtain the disk usage for directories within the path "/var":
    Code:
    # du -ax --max-depth 1 /var | sort -n | tail
    # du -ax --max-depth 1 /var/lib | sort -n | tail
    # du -ax --max-depth 1 /var/log | sort -n | tail
    To show the disk usage in a human-readable format then you may also try the following examples (that will report files with sizes in Megabytes or Gigabytes, excluding files with sizes in Kilobytes):
    Code:
    # du -ahx --max-depth 1 /var | sort -k2 | egrep "[0-9](M|G)"
    # du -ahx --max-depth 1 /var/lib | sort -k2 | egrep "[0-9](M|G)"
    # du -ahx --max-depth 1 /var/log | sort -k2 | egrep "[0-9](M|G)"
    Using the disk usage information obtained you may consider whether or not to remove certain files; extreme caution should be practiced to ensure that required files are retained and not inadvertently deleted.

    I would also consider ensuring that your logrotate configuration has compression enabled, as seen by the following command and desired output:
    Code:
    # egrep "compress$" /etc/logrotate.conf
    compress
    If the directive "compress" is commented, that is, with an extra character in front of the directive to disable it, then you will want to edit the logrotate configuration file (at a path of "/etc/logrotate.conf") to remove the extra character.
    Code:
    # uncomment this if you want your log files compressed
    #compress
    You may also edit the same configuration file ("/etc/logrotate.conf") to reduce the number of older logs that are archived:
    Code:
    # keep 4 weeks worth of backlogs
    rotate 4

  5. #5
    Member ullalla's Avatar
    Join Date
    Jan 2006
    Posts
    192

    Default

    cPanelDon,

    Thanks for the valuable information.

  6. #6
    Member ullalla's Avatar
    Join Date
    Jan 2006
    Posts
    192

    Default

    though wanted to know is there any other files that we can remove or empty ? without creating any issue on the server?

  7. #7
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by ullalla View Post
    though wanted to know is there any other files that we can remove or empty ? without creating any issue on the server?
    I cannot recommend removing just any file purely to reduce disk usage.

    What I do recommend is to thoroughly inspect what is consuming the most disk usage and then carefully evaluate how the data should be handled by your Systems Administrations personnel.

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,356

    Default Re: /var getting full

    I know this is a really old thread but /var/cpanel/bandwidth has almost 7 gigs in it. How can I make sure removed accounts bandwidth is not there and is there a way to rotate some of the data off?

  9. #9
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,891
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: /var getting full

    Quote Originally Posted by DWHS.net View Post
    I know this is a really old thread but /var/cpanel/bandwidth has almost 7 gigs in it. How can I make sure removed accounts bandwidth is not there and is there a way to rotate some of the data off?
    This post by cPanelKenneth should prove helpful I think: /var/cpanel/bandwidth folder size
    Fav cPlinks this week: Blog - cPanel & WHM 11.32 we love it! | cPanel University study for it! | Attracta is coming! we want this!

  10. #10
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,356

    Default Re: /var getting full

    Quote Originally Posted by Infopro View Post
    This post by cPanelKenneth should prove helpful I think: /var/cpanel/bandwidth folder size
    Your right, thanks!

Similar Threads & Tags
Similar threads

  1. /var 88% full
    By screege in forum Optimization
    Replies: 6
    Last Post: 10-20-2010, 06:13 PM
  2. /var is 80% full due to /var/log/btmp
    By discovery in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-27-2010, 02:26 AM
  3. /var full
    By hikaro in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-05-2007, 02:08 PM
  4. /var full
    By mind-field in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-09-2004, 10:55 AM
  5. /var 84% full
    By dgs in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 12-18-2002, 07:56 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube