If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Db2diag.log

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-05-07, 12:17
rajesh_1972 rajesh_1972 is offline
Registered User
 
Join Date: Oct 2006
Posts: 15
Cool Db2diag.log

I have build a unix script to delete last 30 days of entry from db2diag.log. Is there any command to delete the entries for the past 30 days and compress the existing db2diag.log file. Please let me know how can i do it.

Regards
Rajesh Krishnan

Last edited by rajesh_1972; 07-05-07 at 12:44.
Reply With Quote
  #2 (permalink)  
Old 07-05-07, 16:57
rajesh_1972 rajesh_1972 is offline
Registered User
 
Join Date: Oct 2006
Posts: 15
db2diag.log

Found a solution the problem.

In order to delete the entries in db2diag.log you can do the following
Run the following command
find . -mtime +30
Delete the file prior to 30 days
find . -mtime +30 -exec rm {}\;

Regards
Rajesh Krishnan
Reply With Quote
  #3 (permalink)  
Old 07-06-07, 06:48
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
This will only work if you rename the db2diag.log every day so that DB2 starts a new file each day. Otherwise, the db2diag.log will continue to collect new messages and the modified-timestamp won't be older than 30 days.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On