ESP dSeries Workload Automation

 View Only
  • 1.  Clearing auditlog.xxxxxxxx.bin and clilog.xxxx-xx-xxx*

    Posted Sep 29, 2020 02:08 PM
    The housekeeping utility does a nice job at purging the tracelogs, and the log sizes are kept rolling with the parameters, but I am starting to gather quite an impressive volume of disk-hogging clilog and auditlog files. Rather than just deleting them with a powershell, is there a cleaner way to purge these out?


  • 2.  RE: Clearing auditlog.xxxxxxxx.bin and clilog.xxxx-xx-xxx*

    Broadcom Employee
    Posted Sep 30, 2020 09:15 AM

    Hi,
    So auditlogs cannot by deleted by app it using purgelog.  This is because it has all the audit information.  To prevent any accidents, application has no way to delete them.  Like you mentioned, you will need to use an external command or script to clear them.  You may open an idea to add clilog to the purgelog commands.

    HTH,
    Nitin Pande



    ------------------------------
    Support
    Broadcom
    Toronto
    ------------------------------



  • 3.  RE: Clearing auditlog.xxxxxxxx.bin and clilog.xxxx-xx-xxx*

    Posted Sep 30, 2020 09:42 AM
    Here is what I put together. I added two jobs to HOUSEKEEPING to execute this - one for cli and one for audit.

    #Script will delete logs from the directory specified back the number of days passed in via parameter
    param (
    [string]$LogType = "undefined",
    [string]$DaysBack = "10"
    )

    #Set the days back to be a negative number
    if ($DaysBack -gt 0 ) {
    $DaysBack = 0 - $DaysBack
    }

    #Set the log directory
    $Path = "C:\Program Files\CA\WorkloadAutomation_R12_2\logs"

    #Set the current date and the log search date
    $CurrentDate = Get-Date
    $DatetoDelete = $CurrentDate.AddDays($DaysBack)

    #Set the logname pattern
    $LogName = $LogType + 'log'

    # Ensure we cannot delete the current data
    if ( $CurrentDate -gt $DateToDelete ) {
    #Make sure the path is real
    if ( Test-Path $Path ) {
    Get-ChildItem $Path -Recurse | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Where-Object { $_.Name -Match "^$LogName" } | Remove-Item
    }
    }