]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-2media
Update
[bacula/bacula] / regress / tests / incremental-2media
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 virtual disk autochanger
8 #
9 TestName="incremental-2media"
10 JobName=Inc2media
11 . scripts/functions
12
13 . config.out
14
15 scripts/cleanup
16 scripts/copy-2disk-confs
17 scripts/prepare-two-disks
18 echo "${cwd}/build" >/tmp/file-list
19
20 change_jobname $JobName
21 start_test
22
23 # Write out bconsole commands
24 cat <<END_OF_DATA >tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out tmp/log1.out
28 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
29 label storage=File volume=TestVolume002 Pool=Default
30 run job=$JobName yes
31 wait
32 messages
33 quit
34 END_OF_DATA
35
36 run_bacula
37
38 echo "Backup 1 done"
39 # make some files for the incremental to pick up
40 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
41 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
42
43 cat <<END_OF_DATA >tmp/bconcmds
44 @$out /dev/null
45 messages
46 @$out tmp/log1.out
47 @# Force Incremental on the second Volume
48 update volume=TestVolume001 VolStatus=Used
49 setdebug level=51 storage=File
50 run level=Incremental job=$JobName storage=File yes
51 wait
52 messages
53 @# 
54 @# now do a restore
55 @#
56 @$out tmp/log2.out
57 setdebug level=51 storage=DDS-4
58 restore where=${cwd}/tmp/bacula-restores select all done 
59 yes
60 wait
61 messages
62 @$out
63 quit
64 END_OF_DATA
65
66 run_bconsole
67
68 check_for_zombie_jobs storage=File
69 stop_bacula
70
71 check_two_logs
72 check_restore_diff
73
74 end_test