Results 1 to 3 of 3

Thread: Db2diag.log

  1. #1
    Join Date
    Oct 2006
    Posts
    15

    Cool Unanswered: 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 13:44.

  2. #2
    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

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •