Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Using PowerShell to parse TSM backup logs

$
0
0

Good afternoon.  I have written a script to evaluate and parse the event logs on several servers that use TSM (Tivoli Storage Manager).

The script has worked for the most part right up to the new year.

Now, without modifying the script the script runs and produces the CSV report file it is designed to, however, it reports the same information multiple times.

I presume this is due to how the date on each line of the log file is being evaluated.

Probably not the best way either. i.e. if($EntryDt -eq $LogEvalDt -or $EntryDt -gt $LogEvalDt)

This is supposed to look at the date of the log entry to see if it is on or after the date being check which is generally the day prior to the current calendar date.  This worked for the most part because I could not work out a way to evaluate the log by get the lines from the last two dates available in the file.

general speaking a backup runs each night on a given server.  I retrieve the logs from each server and put them into a temp directory for the valuzation portion.

My question is given a log entry such as:

01/05/2014 19:00:08 Incremental backup of volume '\\server\c$'

How can I check that the date in that line is equal to or AFTER (greater than) the date being evaluated (i.e. 01/05/2014)?

I basically want everything from the Log evaluation date to the end of the file

Ideas, feedback, suggestions, thoughts welcome

 

I should also note, that the output now begins (in the report) on 12/22/2013, so for whatever reason the if statement shown above evaluates to true that 12/22/2013 is greater than 01/05/2014, but these are strings.  I thought converting to date format via ParseExact would help resolve that, but then I get lots of errors

CJ

 

 


Viewing all articles
Browse latest Browse all 8583

Latest Images

Trending Articles



Latest Images