Re: ntbackup Alerts
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Mon, 6 Oct 2008 08:16:28 +0200
"eWINg" <ewinglai@xxxxxxxxx> wrote in message
news:d3369867-6529-43e2-b5d0-c62914b1bb83@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Oct 3, 2:27 pm, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"eWINg" <ewing...@xxxxxxxxx> wrote in messageThanks for your help!
news:278c03a9-3283-4b00-a787-3501b447bb33@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Oct 2, 9:52 pm, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"eWINg" <ewing...@xxxxxxxxx> wrote in message
news:9f6c66b1-bd4a-4d54-a2c0-5d5c15b9ea59@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 30, 11:46 pm, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"eWINg" <ewing...@xxxxxxxxx> wrote in message
news:c06bb153-be12-4dae-a1d7-f1504cde481f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 30, 4:31 pm, Masterplan <winmasterp...@xxxxxxxxxx> wrote:
Hi,
You can use schtasks command to monitor the scheduled tasks. You
interogate
the tasks like this:
schtasks /query /v /fo:list | findstr /i "Taskname Result"
And then send the result by email with a program like blat for
example.
--
Have a nice day!
http://winmasterplan.blogspot.com
"eWINg" wrote:
Hello all,
I am running ntbackup on Windows 2003 Enterprise Edition
Would anyone tell me if is there is any way I can configure(bat/
vbscript) whereby ntbackup will alert me by email when the backup
job
has completed sucessfully or failed?
Regards and Thanks,- Hide quoted text -
- Show quoted text -
I can use blat to email the log file, like
c:\windows\system32\blat.exe "%lastfile%" -t "1...@xxxxxxx" -s "Backup
Report" -mime -server "smtp.server" -f "s...@xxxxxxxxxxxxxxxxx" -q
But how can I select the latest log file attach to mail?
==============
Which log file are you talking about - the one created by the
scheduled
task
or the one created by ntbackup.exe?- Hide quoted text -
- Show quoted text -
OH, I mean the log create by ntbackup, which place in
C:\Documents and Settings\Administrator\Local Settings\Application Data
\Microsoft\Windows NT\NTBackup\data
how can I select the latest log file attach to mail?
================
You can pick the most recent file with this batch file:
@echo off
set folder=d:\temp files
for /F "delims=" %%a in ('dir /od /b "%folder%\*.log"') do set
MostRecent=%%a
echo %MostRecent% is the most recent file.- Hide quoted text -
- Show quoted text -
Thanks for your help!
I wrote a window bat as follow, but it run with error, please HELP!
Run bat under:
C:\Documents and Settings\Administrator\Local Settings\Application Data
\Microsoft\Windows NT\NTBackup\data
Error:
The system cannot find the path specified.
"%a " is the most recent file.
@echo off
set folder="C:\Documents and Settings\Administrator\Local Settings
\Application Data\Microsoft\Windows NT\NTBackup\data"
for /F "delims=" %%a in ('dir /od /b "%folder%\*.log"') do set
set MostRecent=%%a
echo "%MostRecent%" is the most recent file.
Rem Mail latest log file to us
c:\windows\system32\blat.exe "%MostRecent%" -t "m...@xxxxxxxx" -s
"Backup Report" -mime -server "smtp.server" -f
"s...@xxxxxxxxxxxxxxxxx" -q
You added a set of double quotes to Line #2 which I did not have. You also
broke up the line below it and added an extra "set" word. Here is my batch
file again, this time line-numbered:
Line1: @echo off
Line2: set folder=d:\temp files
Line3: for /F "delims=" %%a in ('dir /od /b "%folder%\*.log"') do set
MostRecent=%%a
Line4: echo %MostRecent% is the most recent file.- Hide quoted text -
- Show quoted text -
I complete the task with the following script.
Please point me out, if there's anything can improve. thanks a lot!
@echo on
setlocal
Rem Set folder name containing backup log files
set fld=C:\Documents and Settings\Administrator\Local Settings
\Application Data\Microsoft\Windows NT\NTBackup\data\
Rem This dir command will list all log files sorted by date in bare
format
set fcmd=dir "%fld%*.log" /OD /A-D /B
Rem set command will set lastf variable to the last file in set, i.e.
the latest one
for /F "tokens=* delims= " %%i in ('%fcmd%') do set lastf=%fld%%%i
Rem Mail latest log file to us
c:\windows\system32\blat.exe "%lastf%" -t "recciver@xxxxxxxxxxxx" -s
"Backup Report" -mime -server "smtp.XXX.org" -f
"bkpserver@mailaddress" -q
========================
Looks fine to me. I would probably simplify the following line somewhat.
Instead of writing
for /F "tokens=* delims= " %%i in ('%fcmd%') do set lastf=%fld%%%i
I would write
for /F "delims=" %%i in ('%fcmd%') do set lastf=%fld%%%i
Note the missing space after the "=" sign.
.
- Follow-Ups:
- Re: ntbackup Alerts
- From: eWINg
- Re: ntbackup Alerts
- References:
- Re: ntbackup Alerts
- From: eWINg
- Re: ntbackup Alerts
- From: Pegasus \(MVP\)
- Re: ntbackup Alerts
- From: eWINg
- Re: ntbackup Alerts
- From: Pegasus \(MVP\)
- Re: ntbackup Alerts
- From: eWINg
- Re: ntbackup Alerts
- Prev by Date: Re: ntbackup Alerts
- Next by Date: DPM 2007 Question
- Previous by thread: Re: ntbackup Alerts
- Next by thread: Re: ntbackup Alerts
- Index(es):
Relevant Pages
|