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 09-09-2009, 01: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, 01:47 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Cheers,
Tink
 
Old 09-10-2009, 11:15 PM   #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-10-2009, 11:25 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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



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 08:36 PM
log script cmontr Linux - Software 7 06-12-2009 02:19 AM
start script during log off jpostma Slackware 7 07-20-2007 04:43 PM
Bash script for server log (namely var/log/messages) tenaciousbob Programming 17 05-24-2007 10:43 AM
cleaning the readability of this ruby script hedpe Programming 1 12-26-2006 02:46 PM

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

All times are GMT -5. The time now is 02:31 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