LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-24-2008, 02:15 PM   #1
xmdms
Member
 
Registered: Oct 2003
Posts: 134

Rep: Reputation: 15
Best way to delete old unwanted log files??


Hello Linux Gurus,

What would be the best way to purge old unwanted files by the volume without bringing down the server due to spike CPU processing?

Please advise.

Thanks,
J
 
Old 10-24-2008, 02:28 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,590

Rep: Reputation: 187Reputation: 187
I recommend that you use logrotate.

http://linuxcommand.org/man_pages/logrotate8.html

-----------------------
Steve Stites
 
Old 10-24-2008, 03:11 PM   #3
xmdms
Member
 
Registered: Oct 2003
Posts: 134

Original Poster
Rep: Reputation: 15
These log files are being generated through in-house process. Could I use this utility "logrotate" to clean up other log files being generated through other process? There are couple thousands of these files and I would like to clean them up on a daily bases.

Thank you so much for your advice.

J
 
Old 10-24-2008, 03:32 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,445
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Hi,

Yes!

Code:
excerpt from 'man logrotate';

LOGROTATE(8)             System Administrator's Manual            LOGROTATE(8)

NAME
       logrotate - rotates, compresses, and mails system logs

SYNOPSIS
       logrotate [-dv] [-f|--force] [-s|--state file] config_file+

DESCRIPTION
       logrotate  is  designed to ease administration of systems that generate
       large numbers of log files.  It allows automatic rotation, compression,
       removal, and mailing of log files.  Each log file may be handled daily,
       weekly, monthly, or when it grows too large.

       Normally, logrotate is run as a daily cron job.  It will not  modify  a
       log  multiple  times  in  one  day unless the criterium for that log is
       based on the log's size and logrotate is being run multiple times  each
       day, or unless the -f or -force option is used.

       Any number of config files may be given on the command line. Later con-
       fig files may override the options given in earlier files, so the order
       in  which  the logrotate config files are listed in is important.  Nor-
       mally, a single config file which includes any other config files which
       are  needed  should  be used.  See below for more information on how to
 
Old 10-24-2008, 04:48 PM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
If logrotate doesn't work for you, you can also look into using tmpwatch which comes with most standard distributions.
 
Old 10-25-2008, 12:31 PM   #6
xmdms
Member
 
Registered: Oct 2003
Posts: 134

Original Poster
Rep: Reputation: 15
I will check it out - Thank you!

Would you know how to configure it?

J
 
Old 10-27-2008, 10:36 AM   #7
xmdms
Member
 
Registered: Oct 2003
Posts: 134

Original Poster
Rep: Reputation: 15
Question

On the next question;

Would you guys know how to deal with OCFS/OCFS2 Filesystem? I am trying to list out some files in there and it's taking an hour to do so, not mentioning delete files.

Any ideas??

Thanks,

J
 
  


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
HDA5 Full - Where to delete log files? rixride00 Linux - Newbie 3 11-09-2006 01:05 PM
unwanted log messages on the screen pranavchoudhary Red Hat 8 09-07-2006 02:58 AM
Delete Log Files raysr Mandriva 2 01-31-2006 12:15 PM
log what files users create, delete etc. Goma_2 Linux - General 3 09-26-2003 07:12 PM
How to delete unwanted kernels? ludwig W Linux - Software 4 04-14-2003 08:00 AM


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