Jump to content

Recommended Posts

Posted

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?

Posted

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. ;)

Posted
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.  :blush:

 

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 ...

Posted

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!

Posted
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.

 

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.

Posted

Thanks for the suggestion Jim - and the warm welcome, Don. However, Mike! Your suggestion is just what I was looking for. It's perrrrfect. :sweatdrop:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...