]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/virtual-backup-test
Tweak debug levels of virtual backup
[bacula/bacula] / regress / tests / virtual-backup-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then do a virtual
4 #   backup to another device.
5 #
6 # This script uses the virtual disk autochanger
7 #
8 TestName="virtual-backup-test"
9 JobName=Vbackup
10 . scripts/functions
11
12
13 scripts/cleanup
14 scripts/copy-migration-confs
15 scripts/prepare-disk-changer
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17
18 change_jobname NightlySave $JobName
19 start_test
20
21 #
22 # Note, we first backup into Pool Default, 
23 #          then Migrate into Pool Full. 
24 #              Pool Default uses Storage=File
25 #              Pool Full    uses Storage=DiskChanger
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @output
30 messages
31 @$out ${cwd}/tmp/log1.out
32 @#setdebug level=100 storage=File
33 label storage=File volume=FileVolume001 Pool=Default
34 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
35 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
36 @# run several jobs
37 run job=$JobName level=Full yes
38 wait
39 messages
40 list jobs
41 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
42 run job=$JobName level=Incremental yes
43 wait
44 messages
45 list jobs
46 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
47 run job=$JobName level=Differential yes
48 wait
49 messages
50 list jobs
51 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
52 run job=$JobName level=Incremental yes
53 wait
54 messages
55 list jobs
56 list volumes
57 @# 
58 @# now do a normal restore of normal backups
59 @#
60 @$out ${cwd}/tmp/log2.out
61 setdebug level=10 dir
62 restore where=${cwd}/tmp/bacula-restores select
63 unmark *
64 mark *
65 done
66 yes
67 list volumes
68 @# should Consolidate Full, Differential and Incremental
69 @#setdebug level=51 storage=DiskChanger
70 run job=$JobName level=VirtualFull yes
71 wait
72 messages
73 list volumes
74 list jobs
75 @# 
76 @# now do a restore of the consolidated Full
77 @#
78 @$out ${cwd}/tmp/log2.out
79 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
80 unmark *
81 mark *
82 done
83 yes
84 wait
85 list volumes
86 list jobs
87 messages
88 @output
89 quit
90 END_OF_DATA
91
92 run_bacula
93 check_for_zombie_jobs storage=File
94 stop_bacula
95
96 check_two_logs
97 check_restore_diff
98 end_test