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.
5 REM This script uses the virtual disk autochanger and two drives
7 SET TestName=2drive-incremental-2disk
8 SET JobName=2drive2disk
11 CALL scripts\functions set_debug 0
14 CALL scripts\copy-2disk-drive-confs >nul 2>&1
15 CALL scripts\prepare-two-disks
17 CALL scripts\functions change_jobname localhost-fd %JobName%
18 CALL scripts\functions start_test
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
24 ECHO %CD:\=/%/tmp/build/ficheriro1.txt>tmp\restore-list
25 ECHO %CD:\=/%/tmp/build/ficheriro2.txt>>tmp\restore-list
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
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
36 CALL scripts\functions run_bacula
37 ECHO ficheriro1.txt >tmp\build\ficheriro1.txt
38 ECHO ficheriro2.txt >tmp\build\ficheriro2.txt
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
42 CALL scripts\functions run_bconsole
43 CALL scripts\functions check_for_zombie_jobs storage=DDS-4
44 CALL scripts\functions stop_bacula
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%
52 REM Delete .c files because we will only restored the txt files
55 CALL scripts\functions check_restore_tmp_build_diff
57 CALL scripts\functions end_test