Results 1 to 6 of 6
  1. #1

    how to delete logs and domlogs automatically

    Hello .

    I have a huge logs and domlogs . it takes around 10GB a week !

    how to delete domlogs automatically ?

    I tried to add a Cron Job like this :
    rm -rf /home/apache/domlogs/*

    but it's now working ..

  2. #2
    How did you add it exactly?

    Try to edit: /etc/crontab

    Add at the end of the file:

    02 4 * * * root rm -rf /home/apache/domlogs/*

    Now restart crond

    /etc/init.d/crond restart

    This should delete your logs daily.

  3. #3

    Exclamation deleting domlogs On centos

    Hi,
    i'm having the same problem, and i'm wondering how to delete the domlogs in centos ??

  4. #4
    Quote Originally Posted by Exigo Network View Post
    How did you add it exactly?

    Try to edit: /etc/crontab

    Add at the end of the file:

    02 4 * * * root rm -rf /home/apache/domlogs/*

    Now restart crond

    /etc/init.d/crond restart

    This should delete your logs daily.
    Thank you Exigo

    I tried it . but not working .

    How to edit /etc/crontab by shell ?

    I did it by downloading the file to my PC and edit it . Is this working ? or should I edit only By shell ?

  5. #5

    * edit cron

    use this command:

    crontab -e

    #press enter then insert;

    02 4 * * * root rm -rf /home/apache/domlogs/*

  6. #6
    Join Date
    Apr 2010
    Location
    Lansing, MI
    Posts
    422
    Quote Originally Posted by ameera View Post
    Hello .

    I have a huge logs and domlogs . it takes around 10GB a week !

    how to delete domlogs automatically ?

    I tried to add a Cron Job like this :
    rm -rf /home/apache/domlogs/*

    but it's now working ..
    Quote Originally Posted by mcfreder View Post
    use this command:

    crontab -e

    #press enter then insert;

    02 4 * * * root rm -rf /home/apache/domlogs/*
    There are better ways to do what you're trying to do, but first a comment about what you've got so far:

    Did that work for you? If you're logged in as root, that will add it to the root crontab, which should work well. However, your command might give you some errors, unless I'm missing something.

    '02 4 * * * root rm -rf /home/apache/domlogs/*'

    The entire entry, after the time entry (the 02 4 * * *) is the command. 'root' does not need to be there, and may (or may not) cause problems. The entry should look like this:

    '02 4 * * * rm -rf /home/apache/domlogs/*

    Additionally, after that removal happens you need to restart Apache. I would probably use this:

    '02 4 * * * rm -rf /home/apache/domlogs/ & /etc/init.d/httpd restart*

    (make sure to correct the path to wherever your apache init file is.)

    You might also look here for more information on Cron http://adminschoice.com/crontab-quick-reference

    HOWEVER!

    Two suggestions:

    1) if you're using cPanel it is a much better idea to just set the logs to be deleted after stats generation in WHM.

    2) The other suggestion I have, and probably the best fit available to you: Configuring logrotate to rotate/remove the files on a regular basis is a much better way to approach it.

    This might help with that one: http://www.thegeekstuff.com/2010/07/logrotate-examples/
    Benny Crampton
    Liquid Web - Dedicated Hosting with Heroic Support
    StormOnDemand - Flexible Cloud Hosting Infrastructure
    1-800-580-4985 | Twitter: @liquidweb | @StormOnDemand

Similar Threads

  1. how to delete domlogs?
    By akasharya in forum Hosting Software and Control Panels
    Replies: 3
    Last Post: 09-19-2010, 06:51 AM
  2. Domain access logs (domlogs)
    By HD Fanatic in forum Hosting Security and Technology
    Replies: 0
    Last Post: 09-29-2005, 01:58 PM
  3. Delete emails after 90 days automatically
    By lucid in forum Programming Discussion
    Replies: 9
    Last Post: 11-30-2004, 06:16 PM
  4. How to delete a mysql record automatically?
    By shwathi_a in forum Programming Discussion
    Replies: 5
    Last Post: 07-30-2004, 01:36 AM
  5. How do I delete emails automatically
    By SarrCom.com in forum Dedicated Server
    Replies: 0
    Last Post: 08-25-2003, 03:35 AM

Posting Permissions

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