LinuxQuestions.org
Visit Jeremy's Blog.
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-19-2005, 09:54 PM   #1
samd
LQ Newbie
 
Registered: Jun 2005
Distribution: RH8-FC2/3/4
Posts: 8

Rep: Reputation: 0
Question How to roll logs automatically??


Hello all,
Does anyone know how I should go about rolling logfiles automatically?? I have several logs that I do not want to purge, but do want to archive in some fashion. What would be a good procedure to roll the logs. Possibly have them roll automatically via script out of a crontab. I am still green to linux, but picking it up quick. I am willing to dive into a heavy script if i could have some direction.

-sam
 
Old 07-19-2005, 10:33 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Why re-invent the wheel? :} ... chances are you have to
logrotate already installed, and just need to modify it a
bit for your needs?
 
Old 07-20-2005, 04:45 PM   #3
samd
LQ Newbie
 
Registered: Jun 2005
Distribution: RH8-FC2/3/4
Posts: 8

Original Poster
Rep: Reputation: 0
do you know what the module name is? and where it may be.....on RH9 standard install?

thanks, sam
 
Old 07-20-2005, 05:04 PM   #4
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 46
Depending on what syslog you use, it may even be a built-in function. I use metalogger, which keeps logs separate by itself. . .
 
Old 07-20-2005, 08:14 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
The way I understand it, it's pretty standard on most systems. Try "whereis logrotate" to see if you have it and "man logrotate" to see how to use it.
 
Old 07-27-2005, 12:32 PM   #6
ciscohead
Member
 
Registered: Mar 2003
Distribution: redhad 7.3
Posts: 42

Rep: Reputation: 15
logrotating directories

I have virtual servers and each virtual has its own serverlog. I keep all the serverlogs in a directory. If I specify the whole directory what will happen?
 
Old 07-27-2005, 12:50 PM   #7
ciscohead
Member
 
Registered: Mar 2003
Distribution: redhad 7.3
Posts: 42

Rep: Reputation: 15
specifically.....

I have read man logrotate but it is not clear how to do directories.

here is the additional conf block I made

#webserver access logs
/usr/local/apache/logs {
rotate 5
size=100k
sharedscripts
postrotate
/sbin/killall -HUP httpd
endscript
}

Here is what came back:
rotating pattern: /usr/local/apache/logs 102400 bytes (5 rotations)
empty log files are rotated, old logs are removed
not running shared postrotate script, since no logs were rotated

and the logs were unchanged. I definitely have some over 100K, they're killing my diskspace
How can I clear out the ancient dreck, while keeping the last few weeks or so.

Thanks for any hlp!
 
  


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
I want to automatically run a program when a user logs on their account bad_andy Linux - Newbie 7 02-01-2005 08:55 PM
how to get citrix automatically started up when a user logs in. sjel Linux - Newbie 2 09-06-2004 08:40 AM
Getting vncserver to run automatically when user logs in indespair Linux - Networking 2 10-26-2003 02:37 AM
Mandrake automatically logs into kde MrPolite Linux - General 3 03-17-2003 01:01 PM
RedHat logs me out automatically glass Linux - Distributions 5 11-03-2002 10:36 AM


All times are GMT -5. The time now is 01:14 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration