]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-2disk
Final changes
[bacula/bacula] / regress / tests / incremental-2disk
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do an Incremental and restore those two files.
5 #
6 # This script uses the virtual disk autochanger
7 #
8 TestName="incremental-2disk"
9 JobName=Inc2disk
10 . scripts/functions
11 set_debug 0
12
13 . config.out
14
15 stop_bacula
16 cd bin
17 ./drop_bacula_tables >/dev/null 2>&1
18 ./make_bacula_tables >/dev/null 2>&1
19 ./grant_bacula_privileges 2>&1 >/dev/null
20 cd ..
21
22 scripts/copy-2disk-confs
23 scripts/prepare-two-disks
24
25 echo "${cwd}/tmp/build" >/tmp/file-list
26 if test ! -d ${cwd}/tmp/build ; then
27    mkdir ${cwd}/tmp/build
28 fi
29 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
30 cd ${cwd}/tmp
31 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
32 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
33 cd ${cwd}
34
35 change_jobname $JobName
36 start_test
37
38 # Write out bconsole commands
39 cat <<END_OF_DATA >tmp/bconcmds
40 @$out /dev/null
41 messages
42 @$out tmp/log1.out
43 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
44 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=0
45 run job=$JobName yes
46 wait
47 messages
48 quit
49 END_OF_DATA
50
51 run_bacula
52
53 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
54 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
55
56
57 cat <<END_OF_DATA >tmp/bconcmds
58 @$out /dev/null
59 messages
60 @$out tmp/log1.out
61 @# Force Incremental on the second Volume
62 update volume=TestVolume001 VolStatus=Used
63 run level=Incremental job=$JobName yes
64 wait
65 messages
66 @# 
67 @# now do a restore
68 @#
69 @$out tmp/log2.out
70 restore where=${cwd}/tmp/bacula-restores 
71 7
72 <${cwd}/tmp/restore-list
73
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=File
84 stop_bacula
85 #
86 # Delete .c files because we will only restored the txt files
87 #
88 rm -f tmp/build/*.c
89
90 check_two_logs
91 check_restore_tmp_build_diff
92 end_test