Activity Stream
48,167 MEMBERS
61053 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default error_log How to delete all via SSH?

    Hello,

    Today I check few of my websites folder under my web server I found that most of the folders contains the file "error_log" at some folders it is in smaller size but in others its around 600-900 MB in size per file. My question is

    1. Whether its wise to stop creation of that file by Apache? If yes then how to stop it?

    2. Second question is can we stop it for only few websites?

    3. And is that safe to delete error_log file? If yes how to search that file in SSH and how to delete it using one command as it would be really hard to delete one by one from each folder.

    EDIT about question 3:

    I found this command:
    Code: 
    cd /home
    find . -name error_log
    find . -name error_log -exe rm -f {} \;
    find . -name error_log
    
    the above commands will first find all files and list them, the next one will find all files and remove them, the last will confirm that all the error log files have been deleted.
    But the command below dont work:
    Code: 
    find . -name error_log -exe rm -f {} \;
    root@server [/home/url]# find . -name error_log -exe rm -f {} \;
    find: invalid predicate `-exe'
    root@server [/home/url]#
    Please help me with this. Thank you!

    -Regards.
    Divvy Reviewed by Divvy on . error_log How to delete all via SSH? Hello, Today I check few of my websites folder under my web server I found that most of the folders contains the file "error_log" at some folders it is in smaller size but in others its around 600-900 MB in size per file. My question is 1. Whether its wise to stop creation of that file by Apache? If yes then how to stop it? 2. Second question is can we stop it for only few websites? 3. And is that safe to delete error_log file? If yes how to search that file in SSH and how to Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    how about this one
    #!/bin/bash
    find -name error_log | while read ee; do
    rm -rvf $ee
    done

  4.     
    #3
    Member
    Thank you! It is safe?

  5.     
    #4
    Member
    1. Apache won't create those files unless you have defined somewhere in your websites configuration files. It is good to have error been logged somewhere to investigate in case any issues occur. You can set a cronjob to delete/empty those error_log files on a weekly basis.

    2. Yes, you can. You have to check your websites configuration files.

    3. Yes, it is safe but as said in the first point they are good to have incase any issues arise.

    The command you used is correct, the incorrect part was the 'exe' part. It should be 'exec' and not 'exe'

    find . -name error_log -exec rm -f {} \;
    Linux System Administrator
    Server Management at affordable cost.
    linuxhostingsupport.net | MSN:madaboutlinux@hotmail.com

  6.     
    #5
    Respected Member
    This
    find . -name error_log -exe rm -f {} \;

    Should be
    find . -name error_log -exec rm -f {} \;

    Sorry madaboutlinux missed your post. :LOL:

  7.     
    #6
    Member
    Thank you guys, excellent

  8.     
    #7
    Respected Member
    You are welcome.

  9.     
    #8
    Member
    I suggest checking through your error_logs before you delete them.
    Could prove to be a life saver if your sites should just stop working
    This is the staff, you have been banned

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. error_log
    By Divvy in forum Server Management
    Replies: 1
    Last Post: 16th Dec 2011, 09:40 PM
  2. how to delete error_log file in ftp?
    By wman in forum Technical Help Desk Support
    Replies: 2
    Last Post: 19th Oct 2010, 09:48 AM
  3. Please Delete
    By adultguru in forum Community Cooperative
    Replies: 0
    Last Post: 19th Sep 2010, 12:14 PM

Tags for this Thread

BE SOCIAL