]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-test
Delete unwanted subdirectory
[bacula/bacula] / regress / tests / incremental-test
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 TestName="incremental-test"
7 JobName=Incremental 
8 . scripts/functions
9
10 scripts/cleanup
11 scripts/copy-test-confs
12 echo "${cwd}/tmp/build" >/tmp/file-list
13 mkdir ${cwd}/tmp/build
14 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
15 cd ${cwd}/tmp
16 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
17 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
18 cd ${cwd}
19
20 change_jobname CompressedTest $JobName
21 start_test
22
23 cat <<END_OF_DATA >tmp/bconcmds
24 @output /dev/null
25 messages
26 @$out tmp/log1.out
27 @#setdebug level=100 storage=File
28 label storage=File volume=TestVolume001
29 label storage=File volume=TestVolume002
30 run job=$JobName yes
31 wait
32 messages
33 quit
34 END_OF_DATA
35
36 run_bacula
37 check_for_zombie_jobs storage=File
38 #
39 # Now create two new files to be restored later
40 #
41 sleep 1
42 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
43 cp -f ${cwd}/tmp/build/dird.c ${cwd}/tmp/build/ficheriro2.txt
44
45 cat <<END_OF_DATA >tmp/bconcmds
46 @output /dev/null
47 messages
48 @$out tmp/log1.out
49 @# Force Incremental on the second Volume
50 update volume=TestVolume001 VolStatus=Used
51 run level=Differential job=$JobName yes
52 wait
53 messages
54 quit
55 END_OF_DATA
56
57 run_bconsole
58
59 sleep 1
60 touch ${cwd}/tmp/build/ficheriro1.txt
61 touch ${cwd}/tmp/build/ficheriro2.txt
62
63 cat <<END_OF_DATA >tmp/bconcmds
64 @output /dev/null
65 messages
66 @$out tmp/log1.out
67 run level=Incremental job=$JobName yes
68 wait
69 messages
70 quit
71 END_OF_DATA
72
73 run_bconsole
74
75 sleep 1
76 cd ${cwd}/tmp/build
77 cp -f ficheriro2.txt 1
78 sed "s%a%b%g" 1 >ficheriro2.txt
79 rm -f 1
80 cd ${cwd}
81 cat <<END_OF_DATA >tmp/bconcmds
82 @output /dev/null
83 messages
84 @$out tmp/log1.out
85 run level=Differential job=$JobName yes
86 wait
87 messages
88 quit
89 END_OF_DATA
90
91 run_bconsole
92
93 sleep 1
94 touch ${cwd}/tmp/build/ficheriro1.txt
95 touch ${cwd}/tmp/build/ficheriro2.txt
96 cat <<END_OF_DATA >tmp/bconcmds
97 @output /dev/null
98 messages
99 @$out tmp/log1.out
100 run level=Incremental job=$JobName yes
101 wait
102 messages
103 quit
104 END_OF_DATA
105
106 run_bconsole
107
108 sleep 1
109 touch ${cwd}/tmp/build/ficheriro1.txt
110 touch ${cwd}/tmp/build/ficheriro2.txt
111 cat <<END_OF_DATA >tmp/bconcmds
112 @output /dev/null
113 messages
114 @$out tmp/log1.out
115 run level=Incremental job=$JobName yes
116 wait
117 messages
118 quit
119 END_OF_DATA
120
121 run_bconsole
122
123 sleep 1
124 touch ${cwd}/tmp/build/ficheriro1.txt
125 touch ${cwd}/tmp/build/ficheriro2.txt
126 cat <<END_OF_DATA >tmp/bconcmds
127 @output /dev/null
128 messages
129 @$out tmp/log1.out
130 run level=Incremental job=$JobName yes
131 wait
132 messages
133 quit
134 END_OF_DATA
135
136 run_bconsole
137 sleep 1
138 touch ${cwd}/tmp/build/ficheriro1.txt
139 touch ${cwd}/tmp/build/ficheriro2.txt
140
141 cat <<END_OF_DATA >tmp/bconcmds
142 @output /dev/null
143 messages
144 @$out tmp/log1.out
145 run level=Incremental job=$JobName yes
146 wait
147 messages
148 @# 
149 @# now do a restore
150 @#
151 @output tmp/log2.out
152 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
153 yes
154 wait
155 messages
156 @output
157 quit
158 END_OF_DATA
159
160 run_bconsole
161 check_for_zombie_jobs storage=File
162 stop_bacula
163
164 check_two_logs
165 #
166 # Delete .c files because we will only restored the txt files
167 #
168 rm -f tmp/build/*.c
169 check_restore_tmp_build_diff
170 end_test