elric Posted February 10, 2005 Posted February 10, 2005 I've got a dilemma with my server log files and don't know how to solve it. I've asked TCH and apparently it's not within their remit (even for a 'Fully Managed' 1000GB package) - so I got referred to the forums. Any help would be much appreciated. Now, I have just one site on this server - but it's producing about 2GB of log files every 4 days. I want to be able to clear these, automatically, as they approach the 2Gb point (which is the cut-off point for Apache, apparently), but in such a way that it minimizes the disruption to my cPanel stats. I guess I need to code something in PHP and then set up a Cron job - but I know nothing about PHP and nothing about Cron jobs . Any suggestions? Quote
TCH-Bruce Posted February 10, 2005 Posted February 10, 2005 Welcome to the family and forums elric! Can't help with the script but setting up a cron job is pretty painless and done through cPanel. Select Cron Jobs then select Standard. Enter the full path to the script you are going to run and then select the time and frequency in the boxes that you wish the command to run. That's it. Quote
elric Posted February 10, 2005 Author Posted February 10, 2005 Welcome to the family and forums elric! Can't help with the script but setting up a cron job is pretty painless and done through cPanel. Select Cron Jobs then select Standard. Enter the full path to the script you are going to run and then select the time and frequency in the boxes that you wish the command to run. That's it. <{POST_SNAPBACK}> Thanks for the welcome, Bruce - and thanks for the info on the Cron job - that seems pretty straightforward. Now then, does anybody have a suitable script for a complete PHP newbie ... Quote
Deverill Posted February 10, 2005 Posted February 10, 2005 Welcome home elric! There are scripts to do just about anything on hotscripts.com so I'd look there for what you want. Just go to the PHP section and look around - they have everything there. If not then someone in our family here can help, I'm sure! Quote
MikeJ Posted February 10, 2005 Posted February 10, 2005 Now, I have just one site on this server - but it's producing about 2GB of log files every 4 days. I want to be able to clear these, automatically, as they approach the 2Gb point (which is the cut-off point for Apache, apparently), but in such a way that it minimizes the disruption to my cPanel stats. <{POST_SNAPBACK}> Since you're on a dedicated server, I assume you have access to your WHM. You will probably be much better off just logging into your WHM as root, go to Tweak Settings, then find the option Delete each domain's access logs after stats run under Stats and Logs and check it. Make sure to hit the save button at the bottom of the page after you do that. This should then delete your logs every time the stats run (which should be every night unless you have a high load on your server at night). Then you shouldn't have to worry about scripting anything, nor take a chance of deleting the logs before stats have been run against them. Let me know if that doesn't resolve your problem, and welcome to the forums. Quote
TCH-Don Posted February 10, 2005 Posted February 10, 2005 Welcome to the Family elric We really are like family here. So if you need anything, just ask your new family! We love to help Quote
elric Posted February 10, 2005 Author Posted February 10, 2005 Thanks for the suggestion Jim - and the warm welcome, Don. However, Mike! Your suggestion is just what I was looking for. It's perrrrfect. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.