Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-24-2008, 01:15 PM   #1
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.

Old 10-24-2008, 01:28 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

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

Steve Stites
Old 10-24-2008, 02:11 PM   #3
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.

Old 10-24-2008, 02:32 PM   #4
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,146
Blog Entries: 28

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373


excerpt from 'man logrotate';

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

       logrotate - rotates, compresses, and mails system logs

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

       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, 03:48 PM   #5
LQ Guru
Registered: Jan 2001
Posts: 24,149

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

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

Would you know how to configure it?

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

Original Poster
Rep: Reputation: 15

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??




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

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration