LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 09-09-2009, 02:39 AM   #1
Imranteli
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Rep: Reputation: 0
Question script for cleaning log


Hi friends,
I am using Red Hat Enterprise Linux 5.
I am looking out for a script which can be used to take backup of the log and cleaning it up.
Please help.
 
Old 09-09-2009, 02:47 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Ummm ... what exactly does "cleaning it up" mean to
you, and which log(s) are we talking about?


Cheers,
Tink
 
Old 09-11-2009, 12:15 AM   #3
Imranteli
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Cleaning all the log messages in /var/log.
Thank You.
 
Old 09-11-2009, 12:25 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
I think you're looking for logrotate, which is part of the default install and should already be doing at least some of that work ie creating a new log every so often and compressing the old ones.
You can set various params, and if you look at the working cfgs & docs, you'll see you can call a script during the process.
If you want to send backups to eg another machine, you'll have to add a script, probably using rsync.
Really, we need a more detailed spec of what you are trying to achieve.
 
  


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
Perl or PHP Script that can tail /var/log/auth.log - two-factor authentication tdnnash25 Linux - Server 1 06-18-2009 09:36 PM
log script cmontr Linux - Software 7 06-12-2009 03:19 AM
start script during log off jpostma Slackware 7 07-20-2007 05:43 PM
Bash script for server log (namely var/log/messages) tenaciousbob Programming 17 05-24-2007 11:43 AM
cleaning the readability of this ruby script hedpe Programming 1 12-26-2006 03:46 PM


All times are GMT -5. The time now is 09:40 AM.

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