LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 02: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, 12:57 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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, 01:29 AM   #3
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

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

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

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

Rep: Reputation: 50
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 04:29 AM.
 
  


Reply



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 02:03 PM
Simple question here the_sLiDe Slackware 5 10-23-2004 06:56 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 09:03 PM
simple question wr3ck3d Linux - General 10 03-02-2003 08:01 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 04:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:42 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
Open Source Consulting | Domain Registration