]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-2media
9417c7d0794e367f815b835f853cd42ff5bf4416
[bacula/bacula] / regress / tests / incremental-2media
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory then create some           
9 #   new files, do an Incremental onto a different medium 
10 #   and then restore everything.
11 #
12 # This script uses the virtual disk autochanger
13 #
14 TestName="incremental-2media"
15 JobName=Inc2media
16 . scripts/functions
17
18
19 scripts/cleanup
20 scripts/copy-2disk-confs
21 scripts/prepare-disk-changer
22 echo "${cwd}/build" >${cwd}/tmp/file-list
23
24 change_jobname $JobName
25 start_test
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
33 label storage=File volume=TestVolume002 Pool=Default
34 run job=$JobName yes
35 wait
36 messages
37 quit
38 END_OF_DATA
39
40 run_bacula
41
42 echo "Backup 1 done"
43 # make some files for the incremental to pick up
44 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
45 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
46
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @$out /dev/null
49 messages
50 @$out ${cwd}/tmp/log1.out
51 @# Force Incremental on the second Volume
52 update volume=TestVolume001 VolStatus=Used
53 setdebug level=51 storage=File
54 run level=Incremental job=$JobName storage=File yes
55 wait
56 messages
57 @# 
58 @# now do a restore
59 @#
60 @$out ${cwd}/tmp/log2.out
61 setdebug level=151 storage=tape
62 restore where=${cwd}/tmp/bacula-restores select all done 
63 yes
64 wait
65 restore where=${cwd}/tmp/bacula-restores select all done 
66 yes
67 wait
68 status storage=tape
69 messages
70 quit
71 END_OF_DATA
72
73 run_bconsole
74
75 check_for_zombie_jobs storage=File
76 stop_bacula
77
78 check_two_logs
79 check_restore_diff
80
81 end_test