]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/scripts/cleanup-2tape.cmd.in
Updates
[bacula/bacula] / regress / win32 / scripts / cleanup-2tape.cmd.in
1 REM
2 REM Cleanup left over files -- both before and after test run
3 REM
4
5 setlocal ENABLEDELAYEDEXPANSION
6
7 CALL scripts\cleanup
8
9 IF NOT "@autochanger@" == "nul" (
10    SET slot=0
11    FOR /f %%i in ( 'bin\mtx-changer @autochanger@ loaded 0 dummy 0' ) DO SET slot=%%i
12    IF !slot! NEQ 2 (
13       bin\mtx-changer @autochanger@ unload 0 @tape_drive@ 0
14       bin\mtx-changer @autochanger@ load 2 @tape_drive@ 0
15    )
16    mt -f @tape_drive@ rewind
17    mt -f @tape_drive@ weof
18
19    REM
20    REM If we have an autochanger always load tape in slot 1
21    REM
22    FOR /f %%i in ( 'bin\mtx-changer @autochanger@ loaded 0 dummy 0' ) DO SET slot=%%i
23    IF !slot! NEQ 1 (
24       bin\mtx-changer @autochanger@ unload 0 @tape_drive@ 0
25       bin\mtx-changer @autochanger@ load 1 @tape_drive@ 0
26    )
27 )
28 mt -f @tape_drive@ rewind
29 mt -f @tape_drive@ weof