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