hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Question on log files
Reply

Forum Jump

Question on log files

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Web Hosting Guru
 
Join Date: Jan 2001
Location: Buffalo, NY, USA
Posts: 252
Question

'Allo. Have a bit of a challenge with log files. I'd like to be able to have things set up so that at a regular interval, the server would take the current access and error log, compress it (gzip) and dump it into a \logs directory on my site, then reset the logs. I've seen a few hosts that offer this, but so far am having no luck figuring out how to do it on my current host. (Burst/US when asked said yes you may...new host currently being sought.) Basic specs are I believe a RH 6.2, with CPanel. I tried hunting around the server thru telnet, but every spot that -should- have logs in it only has empty files, and I can't locate the file that the cpanel wants to ftp to me.

Since I've been informed that this particular server config dumps the logs every month to save space and I really prefer to do my own log analysis I'm kinda in a bind.

Help, Hints greatly apreciated.

Thanks!

__________________
Bob Hubbard,
SilverStar WebDesigns Inc

silverstarsites.net



Sponsored Links
  #2  
Old
Web Hosting Master
 
Join Date: Aug 2000
Posts: 2,750
Couldnt you do this with a simple cron Script?

__________________
The Php Support Desk
http://www.phpsupportdesk.com
Custom programming - kunal @ e-phoria.com
http://www.pingzine.com - Ping!Zine. the FREE, FRESH and EXCITING Web Hosting Magazine...

  #3  
Old
Web Hosting Guru
 
Join Date: Jan 2001
Location: Buffalo, NY, USA
Posts: 252
Question

We could. 2 problems:

1- No clue how to write the script. My guess would be something like "gzip source destination" but....

2- No idea where the log files in question are as -every- spot I checked on the server had empty log files, and I couldn't find the file or directory that the CPANEL shows when I click on (download raw log file)

I'm lost.

__________________
Bob Hubbard,
SilverStar WebDesigns Inc

silverstarsites.net

Sponsored Links
  #4  
Old
Retired Moderator
 
Join Date: Dec 2000
Location: Leesburg, VA
Posts: 3,205
Find out from your provider where the log files are located, and I can give you a sample shell script that will do it for you .


__________________
My Political Blog

  #5  
Old
Web Hosting Guru
 
Join Date: Jan 2001
Location: Buffalo, NY, USA
Posts: 252
Smile Thanks!

Ok, we got the info on where the current logs are kept. Can you email the script? Tis greately apreciated!

(also, is this for servers or domains? all of our current accts are resolds at the moment, but we are looking at going dedicated shortly.)

Thanks!

__________________
Bob Hubbard,
SilverStar WebDesigns Inc

silverstarsites.net

  #6  
Old
Retired Moderator
 
Join Date: Dec 2000
Location: Leesburg, VA
Posts: 3,205
Here's the link to the script:

http://www.scriptsolutions.com/progr...eup/index.html

All you need to do is create a cron job that does the backup as often as you want.

You can read more about writing cron jobs here:

http://www.unm.edu/cgi-bin/man-cgi?crontab

Of course, since you are running on Linux, you can just put the script right in:

/etc/cron.half-hourly
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.quarter-daily
/etc/cron.quarter-hourly
/etc/cron.weekly

Hope this helps

__________________
My Political Blog

  #7  
Old
Web Hosting Guru
 
Join Date: Jan 2001
Location: Buffalo, NY, USA
Posts: 252
Smile

Thanks. I apreciate the info on Cron how-tos too, as I honestly have no clue on em, and would hate to start world war III cuz of a typo.

Looks like that will do the trick.

Again, thanks!

__________________
Bob Hubbard,
SilverStar WebDesigns Inc

silverstarsites.net

  #8  
Old
Retired Moderator
 
Join Date: Dec 2000
Location: Leesburg, VA
Posts: 3,205
Great...glad it helped. And no worries, unless the RaQ starts asking "Would you like to play a game?" you are okay.

__________________
My Political Blog

  #9  
Old
Web Hosting Guru
 
Join Date: Jan 2001
Location: Buffalo, NY, USA
Posts: 252
Cool

Got the script installed. Had a few hiccups as it couldn't find the config file (which docs refer to as being part of the actual file), but a little cut n paste magic and I got it up and running great.

Also got a little gzip cron running that shrinks the bugger to a managable size. Question now is, is there an easy way to set cron up to run on the last day of the month?

Again Thanks!

__________________
Bob Hubbard,
SilverStar WebDesigns Inc

silverstarsites.net

  #10  
Old
Retired Moderator
 
Join Date: Dec 2000
Location: Leesburg, VA
Posts: 3,205
Actually, the easiest way is to set it to run on the first day of the month .

__________________
My Political Blog

  #11  
Old
Web Hosting Guru
 
Join Date: Jan 2001
Location: Buffalo, NY, USA
Posts: 252
Unhappy

Problem is the server resets the logs then. So if I ran it then, I'd always be backing up clean logs, rather than full ones. right now, i've got it doing it daily, to a new file, with gzip squashing the file to a more manageable size, but I end up with alot of redundant data.

I'm gonna go do a lil digging in the mean time, but I'm open to suggestions.

thanks again.

__________________
Bob Hubbard,
SilverStar WebDesigns Inc

silverstarsites.net

  #12  
Old
Retired Moderator
 
Join Date: Dec 2000
Location: Leesburg, VA
Posts: 3,205
The quick, kludgy way to do this would be to set a cron job to do what you want you and schedule it to run the 28th, 30th and 31st.

A more elegant method would be to schedule the cron job to run every day. The cron job would run a perl script that checks the date, and if the date matches a preset date it performs an action, otherwise it doesn't do anything.

Let me know if that helps.

__________________
My Political Blog

Reply

Related posts from TheWhir.com
Title Type Date Posted
Single Tweet Brings Dropbox DMCA Takedown Policy into Spotlight Web Hosting News 2014-03-31 04:30:00
The Pirate Bay Uploads Continue to Grow Despite Anti-Piracy Pressure Web Hosting News 2013-12-31 11:33:12
BitTorrent Sync Announces Platform Updates, 1M+ Users Web Hosting News 2013-11-06 13:36:26
Egnyte Synchronizes Google Drive with Private Cloud Storage Web Hosting News 2013-07-17 12:36:21
Malwarebytes Launches Data Scan-and-Backup Service Web Hosting News 2013-05-07 14:51:03


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?