Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2006
    Posts
    166

    Lightbulb how to find and delete error_log files via ssh

    hello mates, l would like to find and delete every files named error_log with a ssh code, is it posssible?

  2. #2
    Join Date
    May 2009
    Posts
    312
    Quote Originally Posted by rcpkrc View Post
    hello mates, l would like to find and delete every files named error_log with a ssh code, is it posssible?
    Why would you want to do that? The file is needed by most services to work.

    You can get the files by find command.

    find / -name error_log -type f

    then rm -f to delete those files, though this is not really recommended

  3. #3
    Join Date
    Jul 2006
    Posts
    166
    I am running some scripts and some small bots that is fetching data and they are creating too much big error_log files like 250 gb in a day.

    I cant use same code in one command? like find and delete???

  4. #4
    Then null the error log, do not delete it

  5. #5
    Join Date
    May 2009
    Posts
    312
    you can null the error_logs using

    > error_log command.

    You can add the same commands in a bash file and run it as a script in cron on a regular basis.

  6. #6
    Join Date
    Jul 2006
    Posts
    166
    Quote Originally Posted by wizan View Post
    Then null the error log, do not delete it
    what do u mean with nulling? nulling will solve my problem ?
    I want to automaticly find and delete error_log files

  7. #7
    Join Date
    May 2009
    Posts
    312
    Quote Originally Posted by rcpkrc View Post
    what do u mean with nulling? nulling will solve my problem ?
    I want to automaticly find and delete error_log files
    nulling means emptying the file. It should solve your problem.

    Add the commands in a bash file and run it as a cron. That will do it for you.

  8. #8
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    6,933


    If you are getting 250gig of error logs a day you are better off fixing the script causing the errors or at least turning off logging of the errors.

    Single line to php.ini would fix(hide) this.
    █ | Hoopla Hosting -
    █ | WordPress Web Hosting New Zealand - Reseller Hosting - cPanel - Zurmo Hosting - Softaculous - CloudFlare

  9. #9
    Join Date
    Aug 2003
    Location
    Edinburgh/London
    Posts
    5,789
    Quote Originally Posted by Hoopla-Brad View Post


    If you are getting 250gig of error logs a day you are better off fixing the script causing the errors or at least turning off logging of the errors.

    Single line to php.ini would fix(hide) this.
    Indeed.

    That's like saying you're driving your car and it's spewing oil out everywhere, how can I make a brush stick to the back of the car to clean it as I drive.

    miniVPS - UK Based Value and Premium VPS Servers!
    Xavvo.com Innovative Hosting for Innovative People!

Similar Threads

  1. Script to delete error_log files..
    By fmosse in forum Systems Management Requests
    Replies: 15
    Last Post: 01-14-2012, 03:40 AM
  2. delete all image files in a directory using ssh
    By 4Drive in forum Hosting Security and Technology
    Replies: 7
    Last Post: 08-17-2010, 08:46 AM
  3. SSH - Find & Delete ?
    By Send Media in forum Hosting Security and Technology
    Replies: 0
    Last Post: 03-11-2010, 01:01 PM
  4. How do I delete files via SSH?
    By bullony13 in forum Hosting Security and Technology
    Replies: 7
    Last Post: 10-19-2004, 08:31 AM
  5. How to find and delete all log files **HELP!!**
    By NiceRsx2002 in forum Dedicated Server
    Replies: 17
    Last Post: 09-13-2002, 03:24 PM

Tags for this Thread

Posting Permissions

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