To follow up on this...
recode.exe was not recoding the entire log file, so I was getting only
a truncated version of it, which was very frustrating.
I have found that the newest version of blat (2.6.2, from
www.blat.net) deals nicely with the backup logs - no conversion
necessary. I'm in the middle of reworking the script to accomodate
this.
On Wed, Feb 20, 2008 at 12:36 PM, Ken Cornetet <[EMAIL PROTECTED]> wrote:
> Here's a script I use. It requires grep, blat and recode.
>
> You will have to create your BKS file (it must be Unicode).
>
> Watch for line wrap.
>
> rem *****************************************************************
> rem *
> rem * Perform fullback to whatever tape is in the drive and email
> rem * report
> rem *
> rem * Ken Cornetet - 06/10/2002
> rem *
> rem * Revision History
> rem *
> rem * When Who What
> rem * ---------------------------------------------------------------
> rem * 06/10/2002 Ken Cornetet Original Issue
> rem * 06/24/2002 Ken Cornetet Added RSM command per Q267574
> rem *
> rem *
> rem * Requires external programs blat, grep, and recode
> rem *
> rem *****************************************************************
>
> set [EMAIL PROTECTED]
> set SMTP={Name of your SMTP relay host here}
> set NAME=FULL BACKUP %DATE% %TIME%
> set LOGS=%USERPROFILE%\Local Settings\Application Data\Microsoft\Windows
> NT\NTBackup\data
>
> c:
> cd \backup
>
> rem Delete any extraneous log files
> del "%LOGS%\backup*.log"
>
> rem ************************************************************
> rem * Have removable storage management look at tape in drive
> rem * (See Q267574 for details)
> rem ************************************************************
>
> start /wait rsm refresh /lf"BNCHMARK DLT1 SCSI Sequential Device"
> c:\bin\sleep 30
>
> rem ************************************************************
> rem * Do Backup
> rem ************************************************************
>
> start /wait ntbackup backup @c:\backup\everything.bks /M normal /J
> "%NAME%" /P DLT /N "%NAME%" /l:s /HC:on /UM /D "%NAME%"
>
> rem ************************************************************
> rem * find newest (should be only) log file
> rem ************************************************************
>
> dir /s /b /o-d "%LOGS%\backup*.log" >c:\backup\backup.tmp
> set /P FILE= <c:\backup\backup.tmp
>
> rem ************************************************************
> rem * Make ASCII version of log file
> rem ************************************************************
>
> c:\bin\recode -f unicode..us <"%FILE%" >log.txt
>
>
> rem ************************************************************
> rem * Set subject for email
> rem ************************************************************
>
> set SUBJ=Backup ran OK
> grep -v "Error: You do not have permission" log.txt > log1.txt
>
> findstr /i error: log1.txt
> if not ERRORLEVEL 1 set SUBJ=Backup ran - FAILED
>
> rem ************************************************************
> rem * Send email
> rem ************************************************************
>
> c:\bin\blat log.txt -t %RECIPIENT% -subject "%SUBJ%" -server %SMTP% -f
> %RECIPIENT%
>
> rem ************************************************************
> rem * Move log file to our directory
> rem ************************************************************
>
> move /Y "%FILE%" c:\backup
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~