S
stijn.calders
Hi,
I use this batch script as a scheduled task to make tape backups of a
Windows 2003 server:
del backup*.log
@echo off
Set [email protected]
Set MAILHOST=our_mailserver
start /wait c:\windows\system32\rsm.exe refresh /LF"Compaq AIT 35 GB
LVD drive"
sleep 30
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dd=%%i-%%j-%%k-
%%l
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%l-%%k-%%j-
%%i
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
Set dt=%dt%
set dtt=%dd%%tm%
gbmail -to %MAILTO% -s Backup_is_started_on_SAWADM02 -h %MAILHOST%
c:\windows\system32\ntbackup.exe backup "@D:\Jobs\busawadm02.bks" /d
"daily %dtt%" /v:no /r:no /rs:no /hcn /m normal /j "daily %dtt%" /
l:f /p "8mm AIT1" /UM
c:\windows\system32\rsm.exe eject /PF"%computername%-%dtt% - 1" /
astart
find "Backup completed" backup*.log
if errorlevel 1 goto end1a
echo BACKUP SAWADM02 logfile werd aangemaakt > gelukt.txt
gbmail -to %MAILTO% -cc %MAILCC% -file gelukt.txt -s
Backup_finished_successfully_on_SAWADM02 -h %MAILHOST%
goto end1b
:end1a
echo BACKUP SAWADM02 MISLUKT > mislukt.txt
gbmail -to %MAILTO% -cc %MAILCC% -file mislukt.txt -s
Backup_failed_on_SAWADM02 -h %MAILHOST%
:end1b
rename backup*.log %computername%-%dt%.log
This script worked before I reinstalled the server. After
reinstallation, the scheduled job fails to backup the data without
writing an error in the log file. If I run this script interactively,
the backup goes fine!
Does someone know why the scheduled job fails and has a solution for
this problem?
Many thanks in advance,
Stijn Calders
I use this batch script as a scheduled task to make tape backups of a
Windows 2003 server:
del backup*.log
@echo off
Set [email protected]
Set MAILHOST=our_mailserver
start /wait c:\windows\system32\rsm.exe refresh /LF"Compaq AIT 35 GB
LVD drive"
sleep 30
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dd=%%i-%%j-%%k-
%%l
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%l-%%k-%%j-
%%i
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
Set dt=%dt%
set dtt=%dd%%tm%
gbmail -to %MAILTO% -s Backup_is_started_on_SAWADM02 -h %MAILHOST%
c:\windows\system32\ntbackup.exe backup "@D:\Jobs\busawadm02.bks" /d
"daily %dtt%" /v:no /r:no /rs:no /hcn /m normal /j "daily %dtt%" /
l:f /p "8mm AIT1" /UM
c:\windows\system32\rsm.exe eject /PF"%computername%-%dtt% - 1" /
astart
find "Backup completed" backup*.log
if errorlevel 1 goto end1a
echo BACKUP SAWADM02 logfile werd aangemaakt > gelukt.txt
gbmail -to %MAILTO% -cc %MAILCC% -file gelukt.txt -s
Backup_finished_successfully_on_SAWADM02 -h %MAILHOST%
goto end1b
:end1a
echo BACKUP SAWADM02 MISLUKT > mislukt.txt
gbmail -to %MAILTO% -cc %MAILCC% -file mislukt.txt -s
Backup_failed_on_SAWADM02 -h %MAILHOST%
:end1b
rename backup*.log %computername%-%dt%.log
This script worked before I reinstalled the server. After
reinstallation, the scheduled job fails to backup the data without
writing an error in the log file. If I run this script interactively,
the backup goes fine!
Does someone know why the scheduled job fails and has a solution for
this problem?
Many thanks in advance,
Stijn Calders