View Full Version : Backup Script for Windows 2000 Server


Jim
03-25-2004, 01:48 PM
I have inherited the following script for backing up a server:
--------------------------------------------------------------------
call c:\bat\stop.bat
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
C:\WINNT\system32\NTBACKUP.EXE backup "@C:\bat\daily.bks" /n "Media created
%dtt%" /d "Set created %dtt%" /v:yes /r:no /rs:no /hc:on /m normal /j
"daily.job" /l:s /p "8mm AIT1" /UM
call c:\bat\start.bat
call logmail.bat
---------------------------------------------------------------------

Stop.bat stops some services and start.bat restarts the services.
Logmail.bat adds a header to the backup.log and puts it in the mail pickup
folder.
---------------------------------------------------------------------
The problem is that the output always has 2/14/2003 rather than the current
date:
Backup Status
Operation: Backup
Active backup destination: 4mm DDS
Media name: "Backup Set created 2/14/2003 (DEX/ERMX/SCANX)"

Backup of "C: "
Backup set #1 on media #1
Backup description: "Backup Set created 2/14/2003 (DEX/ERMX/SCANX)"
Backup Type: Normal

Backup started on 2/14/2003 at 9:35 AM.
--------------------------------------------------------------------

I noticed that the Media Name was different from what was passed on through
the script as well as the Backup Set name.

The same script runs on other machines just fine. Apparently, something is
overriding my batch. Any ideas?

Thanks

Jerold Schulman
03-25-2004, 05:05 PM
It is possible that logmail.bat is mailing the wrong log.
Logon as the username that runs the backup.
Open ntbackup.exe and use the Tools menu to see what actually happened.


On Thu, 25 Mar 2004 08:48:52 -0500, "Jim" <wish.i.was@home.now> wrote:

>I have inherited the following script for backing up a server:
>--------------------------------------------------------------------
>call c:\bat\stop.bat
>for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
>for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
>set tm=%tm::=-%
>set dtt=%dt%%tm%
>C:\WINNT\system32\NTBACKUP.EXE backup "@C:\bat\daily.bks" /n "Media created
>%dtt%" /d "Set created %dtt%" /v:yes /r:no /rs:no /hc:on /m normal /j
>"daily.job" /l:s /p "8mm AIT1" /UM
>call c:\bat\start.bat
>call logmail.bat
>---------------------------------------------------------------------
>
>Stop.bat stops some services and start.bat restarts the services.
>Logmail.bat adds a header to the backup.log and puts it in the mail pickup
>folder.
>---------------------------------------------------------------------
>The problem is that the output always has 2/14/2003 rather than the current
>date:
>Backup Status
>Operation: Backup
>Active backup destination: 4mm DDS
>Media name: "Backup Set created 2/14/2003 (DEX/ERMX/SCANX)"
>
>Backup of "C: "
>Backup set #1 on media #1
>Backup description: "Backup Set created 2/14/2003 (DEX/ERMX/SCANX)"
>Backup Type: Normal
>
>Backup started on 2/14/2003 at 9:35 AM.
>--------------------------------------------------------------------
>
>I noticed that the Media Name was different from what was passed on through
>the script as well as the Backup Set name.
>
>The same script runs on other machines just fine. Apparently, something is
>overriding my batch. Any ideas?
>
>Thanks
>


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com

Jerold Schulman
03-25-2004, 05:05 PM
It is possible that logmail.bat is mailing the wrong log.
Logon as the username that runs the backup.
Open ntbackup.exe and use the Tools menu to see what actually happened.


On Thu, 25 Mar 2004 08:48:52 -0500, "Jim" <wish.i.was@home.now> wrote:

>I have inherited the following script for backing up a server:
>--------------------------------------------------------------------
>call c:\bat\stop.bat
>for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
>for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
>set tm=%tm::=-%
>set dtt=%dt%%tm%
>C:\WINNT\system32\NTBACKUP.EXE backup "@C:\bat\daily.bks" /n "Media created
>%dtt%" /d "Set created %dtt%" /v:yes /r:no /rs:no /hc:on /m normal /j
>"daily.job" /l:s /p "8mm AIT1" /UM
>call c:\bat\start.bat
>call logmail.bat
>---------------------------------------------------------------------
>
>Stop.bat stops some services and start.bat restarts the services.
>Logmail.bat adds a header to the backup.log and puts it in the mail pickup
>folder.
>---------------------------------------------------------------------
>The problem is that the output always has 2/14/2003 rather than the current
>date:
>Backup Status
>Operation: Backup
>Active backup destination: 4mm DDS
>Media name: "Backup Set created 2/14/2003 (DEX/ERMX/SCANX)"
>
>Backup of "C: "
>Backup set #1 on media #1
>Backup description: "Backup Set created 2/14/2003 (DEX/ERMX/SCANX)"
>Backup Type: Normal
>
>Backup started on 2/14/2003 at 9:35 AM.
>--------------------------------------------------------------------
>
>I noticed that the Media Name was different from what was passed on through
>the script as well as the Backup Set name.
>
>The same script runs on other machines just fine. Apparently, something is
>overriding my batch. Any ideas?
>
>Thanks
>


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com