Results 1 to 16 of 16
-
01-09-2012, 06:48 PM #1Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 61
Script to delete error_log files..
Hi!
I have two Linux dedicated servers in HostGator.
I need someone to makes me a WHM or Cpanel scripts that once a week should search and delete ALL error_log files.
Is that possible?
I will pay throught Paypal to the person that makes this for me.
Thanks!!!
Francisco
-
01-09-2012, 07:02 PM #2Lord of live chats
- Join Date
- Jul 2009
- Location
- UK
- Posts
- 1,312
Just find the files you want to delete? Then write a bash script then use crontab to delete em.
Ie:
File: delete.sh
rm -f /var/log/httpd/error_log
rm -f blaablaablaa
Then in your crontab.
@weekly ./path/to/file/delete.sh
( probably want to chmod +x delete.sh )Live Chat Support Software for your Business website - IMsupporting.com
-
01-10-2012, 01:24 AM #3Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 61
Hi lynxus!
But I want the the script search in all the sites hosted in my dedi server...
(in the path: /home/)
and delete ALL error_log files automatically.
Thanks!
Francisco
-
01-10-2012, 02:06 AM #4
I can assist you with your requirements, please PM me.
█► AllWorldIT ~ ISP / Hosting Provider / Government / Carrier Solutions
█► HostOnARope ~ 24/7 Support ● Shared Hosting ● Reseller Hosting ● VPS Servers
█► www.hostonarope.com | AllWorldIT Online Product Range | visit AllWorldIT.com
█► Official Proxmox Partner ~ UK/USA/ZA ● Support & SLA's Available
-
01-10-2012, 03:10 AM #5Disabled
- Join Date
- Dec 2009
- Posts
- 162
Laswa Technologies can assist you with this requirement. We are a leading server management company with a very good reputation across WHT. This can be done for a reasonable price. Kindly send in a mail to sales@laswatech.com to get this done.
-
01-10-2012, 04:23 AM #6New Member
- Join Date
- Aug 2011
- Location
- Warsaw, Poland
- Posts
- 1
The script is simple:
find /home/ -type f -name error_log -delete
Just put in root' crontab.
-
01-10-2012, 04:23 AM #7The VPS Specialist
- Join Date
- Aug 2003
- Location
- Edinburgh/London
- Posts
- 5,789
miniVPS - UK Based Value and Premium VPS Servers!
Xavvo.com Innovative Hosting for Innovative People!
-
01-10-2012, 08:43 AM #8Disabled
- Join Date
- Aug 2008
- Location
- Right behind you.
- Posts
- 410
We can do this at just $5. Please do email us on sales@we3cares.com
-
01-10-2012, 06:13 PM #9Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 61
-
01-10-2012, 06:21 PM #10Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 61
Hi nkukard!
I can´t find the PM option anywhere!
What I need is a script that finds and searches ALL “error_log” files hosted in the websites inside 2 dedicated servers in HostGator. I have WHM installed, and I also have SSH Access.
Can you do that or email me the details “step by step”? I will pay you through Paypal. Which would be the cost?
Thanks!
Francisco
-
01-10-2012, 06:23 PM #11New Member
- Join Date
- Aug 2011
- Location
- Warsaw, Poland
- Posts
- 1
Francisco,
Just edit /etc/crontab and insert this code as the bottom line
0 * * * * root find /home/ -type f -name error_log -delete
And it will be executed at 0 minute hourly.
-
01-10-2012, 06:26 PM #12New Member
- Join Date
- Aug 2011
- Location
- Warsaw, Poland
- Posts
- 1
Francisco,
Please PM me for instant help. I can help you with more WHM/Linux tasks as well.
-
01-10-2012, 06:32 PM #13Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 61
They are just "error_log" files that the server generates when there is a 404, 505, etc. error. They are generated inside the directory where the error occurrs. And in the WHM panel of the dedicated server there are no options to "SET OFF" this, or to limit the sizes of the "error_log" files... so they use A LOT of space on the server!
Thanks!
Francisco
-
01-10-2012, 06:39 PM #14New Member
- Join Date
- Aug 2011
- Location
- Warsaw, Poland
- Posts
- 1
Francisco,
The most correct solution is
1. Detect what lines are logged into error_log's and fix the problem
2. Disable logging to error_log into /home/
I can do this.
Erik.
-
01-11-2012, 02:27 PM #15Junior Guru Wannabe
- Join Date
- Jun 2009
- Location
- Houston,Tx
- Posts
- 46
To eliminate all the error log is going to cause clients issues. Some may need to see some of it.
Easiest solution would be to tell php NOT to log errors, set ERror reporting to none:
error_reporting = ~E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = Off
error_log is generated by php, so disabling would eliminate this problem all together.
If you'd still like to provide the error_log, but only in small doses, use logrotate script, or write a bash command that looks for error_logs over a certain size, copies the last 10 lines(just an example) to a temp file, removes the old error_log, puts the temp in it's place, chown it, and you're done there.
-
01-14-2012, 03:40 AM #16Linux Guru
- Join Date
- Mar 2004
- Location
- Odessa, Ukraine
- Posts
- 610
If you have root access I can disable logs totally
Similar Threads
-
rsync delete option only delete files of destination server right?
By chasebug in forum Dedicated ServerReplies: 6Last Post: 06-23-2011, 04:46 PM -
php script question: Delete old files remotely via FTP
By Matt Wiss in forum Programming DiscussionReplies: 0Last Post: 02-23-2010, 05:02 PM -
Turn on error_log files
By acctman in forum Hosting Security and TechnologyReplies: 4Last Post: 09-15-2009, 11:43 AM -
Delete files after a certain period script?
By Doh004 in forum Programming DiscussionReplies: 2Last Post: 01-07-2005, 12:31 AM -
PHP Script to delete old files
By mainarea in forum Programming DiscussionReplies: 11Last Post: 04-09-2003, 01:20 AM