The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Deleting WWW logs

Discussion in 'General Discussion' started by Chris Blount, Jun 24, 2005.

  1. Chris Blount

    Chris Blount Member

    Joined:
    Jan 30, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I've noticed that when my nightly backup routine runs, the www logs are very large. How do I delete them?
     
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    I won't delete these log files, if I were you. If you insist, you can empty them by issuing this command at the prompt: cp /dev/null log_file
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Chris,

    Which logs are you referring to? If you mean the domlogs, then you can save space at the risk of tracing issues in those log files, by checking WHM > Tweak Settings > Delete each domain's access logs after stats run. That way they'll be cleared down once your stats apps have finished processing them. It does mean, though that if you have a compromise through the web server it makes it much more difficult to track down as the logs may well have been purged.
     
  4. Chris Blount

    Chris Blount Member

    Joined:
    Jan 30, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I know about the domlogs and yes, the system does purge them every month.

    What I'm referring to are the www logs that are copied when the backups run. It seems to take a long time. Are the www logs the same as the domlogs?
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Well, there are the site specific logs in /usr/local/apache/domlogs and there are the server-wide logs in /usr/local/apache/logs. I was referring to the ones in domlogs, if you're referring to the ones in logs which are not domain specific, then you should add them correctly into logrotate - you can search the forums on how to do that.
     
  6. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    /usr/local/apache/domlogs are "site specific" logs;
    /usr/local/apache/logs are "Apache specific" logs;
    /var/log/* are the server-wide logs.
     
  7. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    what will happen if I delete all log files in:

    /usr/local/apache/domlogs
    /usr/local/apache/logs
    /var/log/

    my /var is 86% full and wonder if I delete all the files it will effect the server operation. Anybody kindly assist.
     
  8. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    just empty the files:

    >file

    deletion is not suggested.
     
  9. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    what you mean by empty the file, how to do it?
     
  10. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Here is a sample script which can do the job


    cd /usr/local/apache/domlogs/
    for x in `ls`;
    do
    echo "" > $x;
    done;
     
  11. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    >file

    use this to empty.. from shell as root.
     
  12. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Thank you, I'm able to empty the files in log folder, just to check out what is the files inside /var/log/audit.d the file inside this folder take out big space, can I remove this files

    files look like this:

    save.1
    save.10
    save.100
    save.101
    ....
     
  13. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
  14. Stanleytiew

    Stanleytiew Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Thank you very much, I discover that /var/log/audit.d taken so much of the space. I solved my problem.
     
  15. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page