3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory then create some
9 # new files, do an Incremental onto a different medium
10 # and then restore everything.
12 # This script uses the two different tape drives.
14 TestName="incremental-2media-tape"
23 /bin/cp -f scripts/bacula-dir-2d.conf bin/bacula-dir.conf
24 /bin/cp -f scripts/bacula-sd-2d.conf bin/bacula-sd.conf
25 /bin/cp -f scripts/bacula-fd-2d.conf bin/bacula-fd.conf
26 /bin/cp -f scripts/bconsole-2d.conf bin/bconsole.conf
28 # get proper SD tape definitions
29 cp -f scripts/linux_tape_options bin/tape_options
30 if test x`uname` = xFreeBSD ; then
31 cp -f scripts/freebsd_tape_options bin/tape_options
34 mt -f /dev/nst0 rewind
36 mt -f /dev/nst1 rewind
39 echo "${cwd}/build" >${cwd}/tmp/file-list
41 change_jobname $JobName
44 # Write out bconsole commands
45 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @$out ${cwd}/tmp/log1.out
49 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
50 label storage=DLT80 volume=TestVolume002 Pool=Default
60 # make some files for the incremental to pick up
61 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
62 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
67 @$out ${cwd}/tmp/log1.out
68 @# Force Incremental on the second Volume
69 update volume=TestVolume001 VolStatus=Used
70 setdebug level=51 storage=DLT80
71 run level=Incremental job=$JobName storage=DLT80 yes
78 @$out ${cwd}/tmp/log2.out
79 setdebug level=51 storage=tape
80 restore where=${cwd}/tmp/bacula-restores select all done
89 check_for_zombie_jobs storage=DLT80