]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-2media-tape
regress: Tweak vtape-test-changer for more data
[bacula/bacula] / regress / tests / incremental-2media-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do an Incremental onto a different medium 
5 #   and then restore everything.
6 #
7 # This script uses the two different tape drives.
8 #
9 TestName="incremental-2media-tape"
10 JobName=Inc2mediaTape
11 . scripts/functions
12
13 require_tape_drive
14 require_second_drive
15
16 scripts/cleanup
17 # Get conf files
18 /bin/cp -f scripts/bacula-dir-2d.conf bin/bacula-dir.conf
19 /bin/cp -f scripts/bacula-sd-2d.conf bin/bacula-sd.conf
20 /bin/cp -f scripts/bacula-fd-2d.conf bin/bacula-fd.conf
21 /bin/cp -f scripts/bconsole-2d.conf bin/bconsole.conf
22
23 # get proper SD tape definitions
24 cp -f scripts/linux_tape_options bin/tape_options
25 if test x`uname` = xFreeBSD ; then
26    cp -f scripts/freebsd_tape_options bin/tape_options
27 fi
28
29 mt -f /dev/nst0 rewind
30 mt -f /dev/nst0 weof
31 mt -f /dev/nst1 rewind
32 mt -f /dev/nst1 weof
33
34 echo "${cwd}/build" >${cwd}/tmp/file-list
35
36 change_jobname $JobName
37 start_test
38
39 # Write out bconsole commands
40 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
41 @$out /dev/null
42 messages
43 @$out ${cwd}/tmp/log1.out
44 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
45 label storage=DLT80 volume=TestVolume002 Pool=Default
46 run job=$JobName yes
47 wait
48 messages
49 quit
50 END_OF_DATA
51
52 run_bacula
53
54 echo "Backup 1 done"
55 # make some files for the incremental to pick up
56 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
57 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
58
59 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
60 @$out /dev/null
61 messages
62 @$out ${cwd}/tmp/log1.out
63 @# Force Incremental on the second Volume
64 update volume=TestVolume001 VolStatus=Used
65 setdebug level=51 storage=DLT80
66 run level=Incremental job=$JobName storage=DLT80 yes
67 wait
68 list volumes
69 messages
70 @# 
71 @# now do a restore
72 @#
73 @$out ${cwd}/tmp/log2.out
74 setdebug level=51 storage=tape
75 restore where=${cwd}/tmp/bacula-restores select all done 
76 yes
77 wait
78 messages
79 quit
80 END_OF_DATA
81
82 run_bconsole
83
84 check_for_zombie_jobs storage=DLT80
85 stop_bacula
86
87 check_two_logs
88 check_restore_diff
89
90 end_test