Ntbackup on windows2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to make a daily backup with ntbackup on a 35gb DLT drive directly connected to the server. At the beginning of the week I want to put in a tape and remove it at the end of the week. Thus at the end of the week I want to have 5 backup sessions on 1 tape. I've scheduled a batch file with the following command :

- C:\WINDOWS\system32\ntbackup.exe backup "@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G "3ED5F8BD196941E69E495A2F5A2BDE57" /A /V:yes /M normal /hc:o

The log file of the backup shows
Backup Statu
The operation was not performed because an invalid Removable Storage GUID was specified

The Removable Storage GUID I use was found with

- rsm view /Tlibrary /guiddispla

The output this command gives is :

LIBRAR

Off-line Media 9DEB2C0A626F43A283E4DB6A8D2913F
COMPAQ CRN-8245B BB9F9EDA0F9A4B3695122F805CB2D58
Quantum DLT tape drive 3ED5F8BD196941E69E495A2F5A2BDE5

Does anybody know how I get an appendable tape and backup and which commands I have to use ?
 
I am trying to make a daily backup with ntbackup on a 35gb DLT drive directly connected to the server. At the beginning of the week I want to put in a tape and remove it at the end of the week. Thus at the end of the week I want to have 5 backup sessions on 1 tape. I've scheduled a batch file with the following command :

- C:\WINDOWS\system32\ntbackup.exe backup "@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G "3ED5F8BD196941E69E495A2F5A2BDE57" /A /V:yes /M normal /hc:on

The log file of the backup shows :
Backup Status
The operation was not performed because an invalid Removable Storage GUID was specified.

The Removable Storage GUID I use was found with :

- rsm view /Tlibrary /guiddisplay

The output this command gives is :

LIBRARY

Off-line Media 9DEB2C0A626F43A283E4DB6A8D2913FF
COMPAQ CRN-8245B BB9F9EDA0F9A4B3695122F805CB2D582
Quantum DLT tape drive 3ED5F8BD196941E69E495A2F5A2BDE57

Does anybody know how I get an appendable tape and backup and which commands I have to use ?

See tip 7914 and links in the 'Tips & Tricks' at http://www.jsiinc.com

'rsm view /tphysical_media /cg%tape% /guiddisplay
where %tape% is GUID you the tape drive, 3ED5F8BD196941E69E495A2F5A2BDE57


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

I have edited the script as follows :

@echo of
IF {%1}=={} @echo Syntax: FreeMedia TapeString&Exit /b
setloca
set string=%
set string=%string:"=
call :silent>nul 2>&
if not defined media @echo No media in librar
endloca
exit /b
:silen
for /f "Tokens=2-15" %%a in ('rsm view /tlibrary /guiddisplay^|Findstr /i /c:"%string%"') do
if not defined tape if not {%%n}=={} set tape=%%
if not defined tape if not {%%m}=={} set tape=%%
if not defined tape if not {%%l}=={} set tape=%%
if not defined tape if not {%%k}=={} set tape=%%
if not defined tape if not {%%j}=={} set tape=%%
if not defined tape if not {%%i}=={} set tape=%%
if not defined tape if not {%%h}=={} set tape=%%
if not defined tape if not {%%g}=={} set tape=%%
if not defined tape if not {%%f}=={} set tape=%%
if not defined tape if not {%%e}=={} set tape=%%
if not defined tape if not {%%d}=={} set tape=%%
if not defined tape if not {%%c}=={} set tape=%%
if not defined tape if not {%%b}=={} set tape=%%
if not defined tape if not {%%a}=={} set tape=%%

rsm INVENTORY /LG%tape% /AFUL
@ping -n 31 127.0.0.1>nul
for /f "Skip=1 Tokens=2-19" %%a in ('rsm view /tphysical_media /cg%tape% /guiddisplay^|Findstr /v /c:"The command"') do
if not defined media if not {%%r}=={} set media=%%
if not defined media if not {%%q}=={} set media=%%
if not defined media if not {%%p}=={} set media=%%
if not defined media if not {%%o}=={} set media=%%
if not defined media if not {%%n}=={} set media=%%
if not defined media if not {%%m}=={} set media=%%
if not defined media if not {%%l}=={} set media=%%
if not defined media if not {%%k}=={} set media=%%
if not defined media if not {%%j}=={} set media=%%
if not defined media if not {%%i}=={} set media=%%
if not defined media if not {%%h}=={} set media=%%
if not defined media if not {%%g}=={} set media=%%
if not defined media if not {%%f}=={} set media=%%
if not defined media if not {%%e}=={} set media=%%
if not defined media if not {%%d}=={} set media=%%
if not defined media if not {%%c}=={} set media=%%
if not defined media if not {%%b}=={} set media=%%
if not defined media if not {%%a}=={} set media=%%

@ping -n 6 127.0.0.1>nul
for /f "Skip=1 Tokens=2-15" %%a in ('rsm view /tpartition /cg%media% /guiddisplay^|Findstr /v /c:"The command"') do
if not defined part if not {%%n}=={} set part=%%
if not defined part if not {%%m}=={} set part=%%
if not defined part if not {%%l}=={} set part=%%
if not defined part if not {%%k}=={} set part=%%
if not defined part if not {%%j}=={} set part=%%
if not defined part if not {%%i}=={} set part=%%
if not defined part if not {%%h}=={} set part=%%
if not defined part if not {%%g}=={} set part=%%
if not defined part if not {%%f}=={} set part=%%
if not defined part if not {%%e}=={} set part=%%
if not defined part if not {%%d}=={} set part=%%
if not defined part if not {%%c}=={} set part=%%
if not defined part if not {%%b}=={} set part=%%
if not defined part if not {%%a}=={} set part=%%

rsm deallocate /pg%part
@ping -n 6 127.0.0.1>nul
rsm freemedia /pg%media
C:\WINDOWS\system32\ntbackup.exe backup "@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G%tape% /A /V:yes /M normal /hc:o
@ping -n 6 127.0.0.1>nul
rsm eject /pg%media% /ASTAR


And start the backup proces with
Freemedia DL

the backup log says :

Invalid command line parameter '/G3ED5F8BD196941E69E495A2F5A2BDE57'

I'm quite lost now... What am i doing wrong (forgive my ignorence as I am NOT a script wizzard)

Mar

----- Jerold Schulman wrote: ----

On Tue, 11 May 2004 00:16:02 -0700, "Mart" <[email protected]
wrote
I am trying to make a daily backup with ntbackup on a 35gb DLT drive directly connected to the server. At the beginning of the week I want to put in a tape and remove it at the end of the week. Thus at the end of the week I want to have 5 backup sessions on 1 tape. I've scheduled a batch file with the following command :
Backup Status
The operation was not performed because an invalid Removable Storage GUID was specified.
COMPAQ CRN-8245B BB9F9EDA0F9A4B3695122F805CB2D582
Quantum DLT tape drive 3ED5F8BD196941E69E495A2F5A2BDE57

See tip 7914 and links in the 'Tips & Tricks' at http://www.jsiinc.com

'rsm view /tphysical_media /cg%tape% /guiddisplay
where %tape% is GUID you the tape drive, 3ED5F8BD196941E69E495A2F5A2BDE57


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

I have edited the script as follows :

@echo off
IF {%1}=={} @echo Syntax: FreeMedia TapeString&Exit /b 1
setlocal
set string=%1
set string=%string:"=%
call :silent>nul 2>&1
if not defined media @echo No media in library
endlocal
exit /b 0
:silent
for /f "Tokens=2-15" %%a in ('rsm view /tlibrary /guiddisplay^|Findstr /i /c:"%string%"') do (
if not defined tape if not {%%n}=={} set tape=%%n
if not defined tape if not {%%m}=={} set tape=%%m
if not defined tape if not {%%l}=={} set tape=%%l
if not defined tape if not {%%k}=={} set tape=%%k
if not defined tape if not {%%j}=={} set tape=%%j
if not defined tape if not {%%i}=={} set tape=%%i
if not defined tape if not {%%h}=={} set tape=%%h
if not defined tape if not {%%g}=={} set tape=%%g
if not defined tape if not {%%f}=={} set tape=%%f
if not defined tape if not {%%e}=={} set tape=%%e
if not defined tape if not {%%d}=={} set tape=%%d
if not defined tape if not {%%c}=={} set tape=%%c
if not defined tape if not {%%b}=={} set tape=%%b
if not defined tape if not {%%a}=={} set tape=%%a
)
rsm INVENTORY /LG%tape% /AFULL
@ping -n 31 127.0.0.1>null
for /f "Skip=1 Tokens=2-19" %%a in ('rsm view /tphysical_media /cg%tape%
/guiddisplay^|Findstr /v /c:"The command"') do (
if not defined media if not {%%r}=={} set media=%%r
if not defined media if not {%%q}=={} set media=%%q
if not defined media if not {%%p}=={} set media=%%p
if not defined media if not {%%o}=={} set media=%%o
if not defined media if not {%%n}=={} set media=%%n
if not defined media if not {%%m}=={} set media=%%m
if not defined media if not {%%l}=={} set media=%%l
if not defined media if not {%%k}=={} set media=%%k
if not defined media if not {%%j}=={} set media=%%j
if not defined media if not {%%i}=={} set media=%%i
if not defined media if not {%%h}=={} set media=%%h
if not defined media if not {%%g}=={} set media=%%g
if not defined media if not {%%f}=={} set media=%%f
if not defined media if not {%%e}=={} set media=%%e
if not defined media if not {%%d}=={} set media=%%d
if not defined media if not {%%c}=={} set media=%%c
if not defined media if not {%%b}=={} set media=%%b
if not defined media if not {%%a}=={} set media=%%a
)
@ping -n 6 127.0.0.1>null
for /f "Skip=1 Tokens=2-15" %%a in ('rsm view /tpartition /cg%media%
/guiddisplay^|Findstr /v /c:"The command"') do (
if not defined part if not {%%n}=={} set part=%%n
if not defined part if not {%%m}=={} set part=%%m
if not defined part if not {%%l}=={} set part=%%l
if not defined part if not {%%k}=={} set part=%%k
if not defined part if not {%%j}=={} set part=%%j
if not defined part if not {%%i}=={} set part=%%i
if not defined part if not {%%h}=={} set part=%%h
if not defined part if not {%%g}=={} set part=%%g
if not defined part if not {%%f}=={} set part=%%f
if not defined part if not {%%e}=={} set part=%%e
if not defined part if not {%%d}=={} set part=%%d
if not defined part if not {%%c}=={} set part=%%c
if not defined part if not {%%b}=={} set part=%%b
if not defined part if not {%%a}=={} set part=%%a
)
rsm deallocate /pg%part%
@ping -n 6 127.0.0.1>null
rsm freemedia /pg%media%
C:\WINDOWS\system32\ntbackup.exe backup
"@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G%tape% /A
/V:yes /M normal /hc:on
@ping -n 6 127.0.0.1>null
rsm eject /pg%media% /ASTART


And start the backup proces with :
Freemedia DLT

the backup log says :

Invalid command line parameter '/G3ED5F8BD196941E69E495A2F5A2BDE57'.

I'm quite lost now... What am i doing wrong (forgive my ignorence as I am NOT a script wizzard).

Mart

You're doing some pretty fancy stuff but you're tripping over a basic
detail: Put a space after the /G switch, as suggested by the command
"ntbatckup /?".
 
Mart said:
You're doing some pretty fancy stuff but you're tripping over a basic
detail: Put a space after the /G switch, as suggested by the command
"ntbatckup /?".

- Did that, tried it allready, didn't work

C:\WINDOWS\system32\ntbackup.exe backup
"@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G %tape% /A
/V:yes /M normal /hc:on
- Log shows :

Backup Status
The operation was not performed because an invalid Removable Storage GUID was specified.

Adding the space where it belonged got rid of the syntax error. You now need
to sort out your batch file in general. Do you actually know what the long
batch file does that you quoted in your previous note? I don't really want
to wade through the whole thing, as it covers a great many things that you
probably do not require. As a first step I suggest you execute this command
and report its output (verbatim, please, no approximations!):

rsm view /tlibrary /guiddisplay
 
Adding the space where it belonged got rid of the syntax error. You now nee
to sort out your batch file in general. Do you actually know what the lon
batch file does that you quoted in your previous note? I don't really wan
to wade through the whole thing, as it covers a great many things that yo
probably do not require. As a first step I suggest you execute this comman
and report its output (verbatim, please, no approximations!)

rsm view /tlibrary /guiddispla

As I wrote I am NOT a script wizard and I do not understand everything which is in the script. Maybe you could help me out ? In my initial post I wrote (so I allready did that)

The Removable Storage GUID I use was found with

- rsm view /Tlibrary /guiddispla

The output this command gives is :

LIBRAR

Off-line Media 9DEB2C0A626F43A283E4DB6A8D2913F
COMPAQ CRN-8245B BB9F9EDA0F9A4B3695122F805CB2D58
Quantum DLT tape drive 3ED5F8BD196941E69E495A2F5A2BDE5

And in my last post (look at space between /G and %tape%

Did that, tried it allready, didn't wor

C:\WINDOWS\system32\ntbackup.exe backup "@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G %tape% /A /V:yes /M normal /hc:o

- Log shows :

Backup Statu
The operation was not performed because an invalid Removable Storage GUID was specified
 
Mart said:
Adding the space where it belonged got rid of the syntax error. You now need
to sort out your batch file in general. Do you actually know what the long
batch file does that you quoted in your previous note? I don't really want
to wade through the whole thing, as it covers a great many things that you
probably do not require. As a first step I suggest you execute this command
and report its output (verbatim, please, no approximations!):

rsm view /tlibrary /guiddisplay

As I wrote I am NOT a script wizard and I do not understand everything
which is in the script. Maybe you could help me out ? In my initial post I
wrote (so I allready did that) :
The Removable Storage GUID I use was found with :

- rsm view /Tlibrary /guiddisplay

The output this command gives is :

LIBRARY

Off-line Media 9DEB2C0A626F43A283E4DB6A8D2913FF
COMPAQ CRN-8245B BB9F9EDA0F9A4B3695122F805CB2D582
Quantum DLT tape drive 3ED5F8BD196941E69E495A2F5A2BDE57

And in my last post (look at space between /G and %tape% :

Did that, tried it allready, didn't work

C:\WINDOWS\system32\ntbackup.exe backup
"@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G %tape% /A
/V:yes /M normal /hc:on
- Log shows :

Backup Status
The operation was not performed because an invalid Removable Storage GUID was specified.

OK, now copy and paste the following lines into a batch file of your own.
When finished, remove the line numbers - their only purpose is to make it
obvious which lines must be unwrapped.

1 @echo off
2 goto Start
3 ===========================================================
4 This batch file will back up the folder selection previously made by
ntbackup.exe
5 and saved in c:\BackupLogs\backup.bks. It will also copy the latest backup
log
6 file to c:\BackupLogs\Backup.log.
7
8 17 May 2004
9 John Doe
10 ===========================================================
11
12 :Start
13 set Medium=4mm DDS
14 set MSLogs=C:\Documents and Settings\%UserName%\Local
Settings\Application Data\Microsoft\Windows NT\NTBackup\data
15 set MyLogs=c:\BackupLogs
16 if not exist %MyLogs% md %MyLogs%
17
18 %SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%"
/n "%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium /L:S /um
19
20 for %%a in (%MSLogs%\*.log) do echo F | xcopy /d "%%a"
%MyLogs%\Backup.log

Please do not retype these lines. If you do then you will certainly make a
few mistakes that will prevent the batch file from working as it should.
Also note that I don't guarantee that the batch file will work straight
away, as I cannot fully test it on my machine.

There are two more things to do:

a) You must determine the medium descriptor: Control Panel / Admininstrative
Tools / Computer Management / Removable Storage / Media Pools / Backup. The
item under "Backup is the media descriptor. Modify line 13 of the above
batch file, and set it to the correct media descriptor - verbatim, please,
complete with embedded spaces etc!

b) You must create a folder selection file.
- Launch ntbackup.exe
- Click the Backup tab
- Place a tick mark into every folder you wish to back up
- Click Job / Save Selections as
- Type this: c:\BackupLogs\backup.bks
Do not select a different name - it must line up with lines 15 and 18
above.

This is as far as I can take you. The batch file you created will back up
the selected folders to tape every day. Each day, the previous contents of
the tape will be overwritten. I am aware that you wanted to append data each
day. I do not have a ready made batch file to do this - you must experiment
yourself. For one thing you won't be able to use the /um (unmanaged) switch.
Here are some resources to assist you:

- Run ntbackup.exe /?
- http://support.microsoft.com/?kbid=239892
- http://www.jsiinc.com: tips 5955 & 2265
- www.google.com (look for "Removable Storage Manager")

The challenge is not so much to write a batch file but to understand the
intricacies of ntbackup.exe and rsm (Removable Storage Manager).
 
----- Pegasus (MVP) wrote: ----


Mart said:
now nee
to sort out your batch file in general. Do you actually know what th lon
batch file does that you quoted in your previous note? I don't reall wan
to wade through the whole thing, as it covers a great many thing that yo
probably do not require. As a first step I suggest you execute thi comman
and report its output (verbatim, please, no approximations!)
which is in the script. Maybe you could help me out ? In my initial post
wrote (so I allready did that)
COMPAQ CRN-8245B BB9F9EDA0F9A4B3695122F805CB2D58
Quantum DLT tape drive 3ED5F8BD196941E69E495A2F5A2BDE5
"@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G %tape% /
/V:yes /M normal /hc:o
The operation was not performed because an invalid Removable Storag
GUID was specified


OK, now copy and paste the following lines into a batch file of your own
When finished, remove the line numbers - their only purpose is to make i
obvious which lines must be unwrapped

1 @echo of
2 goto Star
3 ==========================================================
4 This batch file will back up the folder selection previously made b
ntbackup.ex
5 and saved in c:\BackupLogs\backup.bks. It will also copy the latest backu
lo
6 file to c:\BackupLogs\Backup.log

8 17 May 200
9 John Do
10 ==========================================================
1
12 :Star
13 set Medium=4mm DD
14 set MSLogs=C:\Documents and Settings\%UserName%\Loca
Settings\Application Data\Microsoft\Windows NT\NTBackup\dat
15 set MyLogs=c:\BackupLog
16 if not exist %MyLogs% md %MyLogs
1
18 %SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%
/n "%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium /L:S /u
1
20 for %%a in (%MSLogs%\*.log) do echo F | xcopy /d "%%a
%MyLogs%\Backup.lo

Please do not retype these lines. If you do then you will certainly make
few mistakes that will prevent the batch file from working as it should
Also note that I don't guarantee that the batch file will work straigh
away, as I cannot fully test it on my machine

There are two more things to do

a) You must determine the medium descriptor: Control Panel / Admininstrativ
Tools / Computer Management / Removable Storage / Media Pools / Backup. Th
item under "Backup is the media descriptor. Modify line 13 of the abov
batch file, and set it to the correct media descriptor - verbatim, please
complete with embedded spaces etc

b) You must create a folder selection file
- Launch ntbackup.ex
- Click the Backup ta
- Place a tick mark into every folder you wish to back u
- Click Job / Save Selections a
- Type this: c:\BackupLogs\backup.bk
Do not select a different name - it must line up with lines 15 and 1
above

This is as far as I can take you. The batch file you created will back u
the selected folders to tape every day. Each day, the previous contents o
the tape will be overwritten. I am aware that you wanted to append data each
day. I do not have a ready made batch file to do this - you must experiment
yourself. For one thing you won't be able to use the /um (unmanaged) switch.
Here are some resources to assist you:

- Run ntbackup.exe /?
- http://support.microsoft.com/?kbid=239892
- http://www.jsiinc.com: tips 5955 & 2265
- www.google.com (look for "Removable Storage Manager")

The challenge is not so much to write a batch file but to understand the
intricacies of ntbackup.exe and rsm (Removable Storage Manager).

This is the batch file :
@echo off
goto Start
REM ===========================================================
REM This batch file will back up the folder selection previously made by ntbackup.exe
REM and saved in c:\BackupLogs\backup.bks. It will also copy the latest backup log
REM file to c:\BackupLogs\Backup.log.
REM
REM 17 May 2004
REM John Doe
REM ===========================================================

:Start
set Medium=DLT
set MSLogs="C:\Documents and Settings\%UserName%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data"
set MyLogs=c:\BackupLogs
if not exist %MyLogs% md %MyLogs%

%SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%" /n "%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium /L:S /um

for %%a in (%MSLogs%\*.log) do echo F | xcopy /d "%%a" %MyLogs%\Backup.log


And this is what the backup log says :

Backup Status
The operation was not performed because an invalid Removable Storage backup destination was specified.
 
Mart said:
----- Pegasus (MVP) wrote: -----


error. You
now need what the
long really things
that you this everything
which is in the script. Maybe you could help me out ? In my initial post I
wrote (so I allready did that) :
"@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G %tape% /A
/V:yes /M normal /hc:on Storage
GUID was specified.

OK, now copy and paste the following lines into a batch file of your own.
When finished, remove the line numbers - their only purpose is to make it
obvious which lines must be unwrapped.

1 @echo off
2 goto Start
3 ===========================================================
4 This batch file will back up the folder selection previously made by
ntbackup.exe
5 and saved in c:\BackupLogs\backup.bks. It will also copy the latest backup
log
6 file to c:\BackupLogs\Backup.log.
7
8 17 May 2004
9 John Doe
10 ===========================================================
11
12 :Start
13 set Medium=4mm DDS
14 set MSLogs=C:\Documents and Settings\%UserName%\Local
Settings\Application Data\Microsoft\Windows NT\NTBackup\data
15 set MyLogs=c:\BackupLogs
16 if not exist %MyLogs% md %MyLogs%
17
18 %SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%"
/n "%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium /L:S /um
19
20 for %%a in (%MSLogs%\*.log) do echo F | xcopy /d "%%a"
%MyLogs%\Backup.log

Please do not retype these lines. If you do then you will certainly make a
few mistakes that will prevent the batch file from working as it should.
Also note that I don't guarantee that the batch file will work straight
away, as I cannot fully test it on my machine.

There are two more things to do:

a) You must determine the medium descriptor: Control Panel / Admininstrative
Tools / Computer Management / Removable Storage / Media Pools / Backup. The
item under "Backup is the media descriptor. Modify line 13 of the above
batch file, and set it to the correct media descriptor - verbatim, please,
complete with embedded spaces etc!

b) You must create a folder selection file.
- Launch ntbackup.exe
- Click the Backup tab
- Place a tick mark into every folder you wish to back up
- Click Job / Save Selections as
- Type this: c:\BackupLogs\backup.bks
Do not select a different name - it must line up with lines 15 and 18
above.

This is as far as I can take you. The batch file you created will back up
the selected folders to tape every day. Each day, the previous contents of
the tape will be overwritten. I am aware that you wanted to append data each
day. I do not have a ready made batch file to do this - you must experiment
yourself. For one thing you won't be able to use the /um (unmanaged) switch.
Here are some resources to assist you:

- Run ntbackup.exe /?
- http://support.microsoft.com/?kbid=239892
- http://www.jsiinc.com: tips 5955 & 2265
- www.google.com (look for "Removable Storage Manager")

The challenge is not so much to write a batch file but to understand the
intricacies of ntbackup.exe and rsm (Removable Storage Manager).

This is the batch file :
@echo off
goto Start
REM ===========================================================
REM This batch file will back up the folder selection previously made by ntbackup.exe
REM and saved in c:\BackupLogs\backup.bks. It will also copy the latest backup log
REM file to c:\BackupLogs\Backup.log.
REM
REM 17 May 2004
REM John Doe
REM ===========================================================

:Start
set Medium=DLT
set MSLogs="C:\Documents and Settings\%UserName%\Local
Settings\Application Data\Microsoft\Windows NT\NTBackup\data"
set MyLogs=c:\BackupLogs
if not exist %MyLogs% md %MyLogs%

%SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%"
/n "%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium /L:S /um
for %%a in (%MSLogs%\*.log) do echo F | xcopy /d "%%a" %MyLogs%\Backup.log


And this is what the backup log says :

Backup Status
The operation was not performed because an invalid Removable Storage
backup destination was specified.
I omitted a % sign by mistake. The line should read like so:

%SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%" /n
"%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium% /L:S /um

By the way, you waited a whole week with your reply. This thread is about to
disappear from my newsreader's horizon. You may have to start a new thread
if you have further queries.
 
----- Pegasus (MVP) wrote: ----


Mart said:
error. Yo
now nee what th
lon reall thing
that yo thi everythin
which is in the script. Maybe you could help me out ? In my initia post
wrote (so I allready did that)
"@D:\Support.SNL\Scripts\Dagelijks.bks" /J "Dagelijks.bks" /G %tape /
/V:yes /M normal /hc:o Storag
GUID was specified own
When finished, remove the line numbers - their only purpose is t make i
obvious which lines must be unwrapped
2 goto Star
3 ==========================================================
4 This batch file will back up the folder selection previously mad b
ntbackup.ex
5 and saved in c:\BackupLogs\backup.bks. It will also copy the lates backu
lo
6 file to c:\BackupLogs\Backup.log

8 17 May 200
9 John Do
10 ==========================================================
1
12 :Star
13 set Medium=4mm DD
14 set MSLogs=C:\Documents and Settings\%UserName%\Loca
Settings\Application Data\Microsoft\Windows NT\NTBackup\dat
15 set MyLogs=c:\BackupLog
16 if not exist %MyLogs% md %MyLogs
1
18 %SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks / "%date%
/n "%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium /L: /u
1
20 for %%a in (%MSLogs%\*.log) do echo F | xcopy /d "%%a
%MyLogs%\Backup.lo make
few mistakes that will prevent the batch file from working as i should
Also note that I don't guarantee that the batch file will wor straigh
away, as I cannot fully test it on my machine Admininstrativ
Tools / Computer Management / Removable Storage / Media Pools Backup. Th
item under "Backup is the media descriptor. Modify line 13 of th above
batch file, and set it to the correct media descriptor - verbatim, please,
complete with embedded spaces etc!
- Launch ntbackup.exe
- Click the Backup tab
- Place a tick mark into every folder you wish to back up
- Click Job / Save Selections as
- Type this: c:\BackupLogs\backup.bks
Do not select a different name - it must line up with lines 15 and 18 back up
the selected folders to tape every day. Each day, the previous contents of
the tape will be overwritten. I am aware that you wanted to append data each
day. I do not have a ready made batch file to do this - you must experiment
yourself. For one thing you won't be able to use the /um (unmanaged) switch.
Here are some resources to assist you:
- http://support.microsoft.com/?kbid=239892
- http://www.jsiinc.com: tips 5955 & 2265
- www.google.com (look for "Removable Storage Manager") the
intricacies of ntbackup.exe and rsm (Removable Storage Manager).
@echo off
goto Start
REM ===========================================================
REM This batch file will back up the folder selection previously made by ntbackup.exe
REM and saved in c:\BackupLogs\backup.bks. It will also copy the latest backup log
REM file to c:\BackupLogs\Backup.log.
REM
REM 17 May 2004
REM John Doe
REM ===========================================================
set Medium=DLT
set MSLogs="C:\Documents and Settings\%UserName%\Local
Settings\Application Data\Microsoft\Windows NT\NTBackup\data"
set MyLogs=c:\BackupLogs
if not exist %MyLogs% md %MyLogs%
The operation was not performed because an invalid Removable Storage
backup destination was specified.
I omitted a % sign by mistake. The line should read like so:

%SystemRoot%\system32\ntbackup.exe backup %MyLogs%\Backup.bks /j "%date%" /n
"%date%" /d "%date%" /v:yes /r:no /rs:no /m Normal /p %Medium% /L:S /um

By the way, you waited a whole week with your reply. This thread is about to
disappear from my newsreader's horizon. You may have to start a new thread
if you have further queries.

I waited a whole week because I was on holiday. Some things have to be done ...:). Anyway I adjusted the batch file and this is what the backup logs says :

Backup Status
Operation: Backup
Active backup destination: DLT
Media name: "do 27-05-2004"

Backup (via shadow copy) of "C: System"
Backup set #1 on media #1
Backup description: "do 27-05-2004"
Media name: "do 27-05-2004"

Backup Type: Normal

Backup started on 27-5-2004 at 17:08.
Backup completed on 27-5-2004 at 17:08.
Directories: 0
Files: 0
Bytes: 0
Time: 5 seconds

----------------------

Verify Status
Operation: Verify After Backup
Active backup destination: DLT

Verify of "C:"
Backup set #1 on media #1
Backup description: "do 27-05-2004"
Verify started on 27-5-2004 at 17:08.
Verify completed on 27-5-2004 at 17:08.
Directories: 0
Files: 0
Different: 0
Bytes: 0
Time: 1 second
 
I waited a whole week because I was on holiday.
Some things have to be done ...:). Anyway I adjusted
the batch file and this is what the backup logs says :

Backup Status
Operation: Backup
Active backup destination: DLT
Media name: "do 27-05-2004"

Backup (via shadow copy) of "C: System"
Backup set #1 on media #1
Backup description: "do 27-05-2004"
Media name: "do 27-05-2004"

Backup Type: Normal

Backup started on 27-5-2004 at 17:08.
Backup completed on 27-5-2004 at 17:08.
Directories: 0
Files: 0
Bytes: 0
Time: 5 seconds

----------------------

Verify Status
Operation: Verify After Backup
Active backup destination: DLT

Verify of "C:"
Backup set #1 on media #1
Backup description: "do 27-05-2004"
Verify started on 27-5-2004 at 17:08.
Verify completed on 27-5-2004 at 17:08.
Directories: 0
Files: 0
Different: 0
Bytes: 0
Time: 1 second
How did you create the .bks file?

Cheers,

Cliff
 
Back
Top