]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/tests/2drive-incremental-2disk.cmd
Delete unwanted subdirectory
[bacula/bacula] / regress / win32 / tests / 2drive-incremental-2disk.cmd
1 REM
2 REM Run a simple backup of the Bacula build directory then create some           
3 REM   new files, do an Incremental and restore those two files.
4 REM
5 REM This script uses the virtual disk autochanger and two drives
6 REM
7 SET TestName=2drive-incremental-2disk
8 SET JobName=2drive2disk
9
10 CALL config_out
11 CALL scripts\functions set_debug 0
12
13 CALL scripts\cleanup
14 CALL scripts\copy-2disk-drive-confs >nul 2>&1
15 CALL scripts\prepare-two-disks
16
17 CALL scripts\functions change_jobname localhost-fd %JobName%
18 CALL scripts\functions start_test
19
20 ECHO %CD:\=/%/tmp/build >\tmp\file-list
21 IF NOT EXIST tmp\build MKDIR tmp\build
22 COPY build\src\dird\*.c tmp\build >nul 2>&1
23
24 ECHO %CD:\=/%/tmp/build/ficheriro1.txt>tmp\restore-list
25 ECHO %CD:\=/%/tmp/build/ficheriro2.txt>>tmp\restore-list
26
27 REM Turn off Prefer Mounted Volumes so we use2 drives
28 COPY bin\bacula-dir.conf tmp\1 >nul 2>&1
29 REM Comment the next line out to write everything to one drive
30 REM  otherwise, it writes the two jobs to different drives
31 sed -e "s;# Prefer Mounted Volumes;  Prefer Mounted Volumes;g" tmp\1 >bin\bacula-dir.conf
32
33 REM Write out bconsole commands
34 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\2drive-incremental-2disk.1.bscr >tmp\bconcmds
35
36 CALL scripts\functions run_bacula
37 ECHO ficheriro1.txt >tmp\build\ficheriro1.txt
38 ECHO ficheriro2.txt >tmp\build\ficheriro2.txt
39
40 sed -e "s;@JobName@;%JobName%;g" -e "s;@out@;%out%;g" -e "s;@topdir@;%CD:\=/%;g" tests\2drive-incremental-2disk.2.bscr >tmp\bconcmds
41
42 CALL scripts\functions run_bconsole
43 CALL scripts\functions check_for_zombie_jobs storage=DDS-4
44 CALL scripts\functions stop_bacula
45
46 CALL scripts\functions check_two_logs
47 REM The restore should read from TestVolume002, which was on drive 1
48 grep TestVolume002 tmp\log2.out >nul 2>&1
49 IF %ERRORLEVEL% NEQ 0 SET rstat=%ERRORLEVEL%
50
51 REM
52 REM Delete .c files because we will only restored the txt files
53 REM
54 DEL tmp\build\*.c
55 CALL scripts\functions check_restore_tmp_build_diff
56
57 CALL scripts\functions end_test