LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2004, 03:48 PM   #1
lexington
Member
 
Registered: Apr 2004
Posts: 53

Rep: Reputation: 15
Please help, simple question about domlogs


Hello, when I look in /usr/local/apache/dmlogs, I see files like this for example:

mysite.com
mysite.com-bytes_log
mysite.com-bytes_log.offset

I host a few sites that have HUGE files about this, is it safe to emtpy these files? If so, how do I do it? Or can I simply delete them and new files will be generated? Thanks
 
Old 07-16-2004, 01:57 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Look at em. See what's in there, if it looks like log files you'd like to keep around, then back em up first. I'd probably bring down my server first, then remove the files, touch new ones, and be on my way. I am pretty sure though that apache will create the log files if none exists, so you can likely just remove them, and not even bother with bringing down the server and touching new ones.

Cool
 
Old 07-16-2004, 02:29 AM   #3
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 49
have you looked at logrotate to do this job for you?
 
Old 07-16-2004, 02:30 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Could you exand on or link to logrotate?

Cool
 
Old 07-16-2004, 05:27 AM   #5
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 49
You can create a file httpd in /etc/logrotate.d with the contents as below
Quote:
/usr/local/apache2/logs/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /usr/local/apache2/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
Of course you may need to modify it to suit your environment.

edit /etc/logrotate.conf and configure it to suit your requirements (e.g. how many weeks worth of log you want to maintain, whether you want to maintain the old logs as plain text or compressed ...)

Last edited by ppuru; 07-16-2004 at 05:29 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 03:03 PM
Simple question here the_sLiDe Slackware 5 10-23-2004 07:56 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 10:03 PM
simple question wr3ck3d Linux - General 10 03-02-2003 09:01 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 05:08 AM


All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration