]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/bacula-dir.conf.testrunscript.in
846e956002ca1c942342c04ba0f11ed9bfa87125
[bacula/bacula] / regress / scripts / bacula-dir.conf.testrunscript.in
1 #
2 # Default Bacula Director Configuration file
3 #
4 #  The only thing that MUST be changed is to add one or more
5 #   file or directory names in the Include directive of the
6 #   FileSet resource.
7 #
8 #  For Bacula release 1.39.27 (24 October 2006) -- debian testing/unstable
9 #
10 #  You might also want to change the default email address
11 #   from root to your address.  See the "mail" and "operator"
12 #   directives in the Messages resource.
13 #
14
15 Director {                            # define myself
16   Name = @hostname@-dir
17   DIRPort = @dirport@                # where we listen for UA connections
18   QueryFile = "@scriptdir@/query.sql"
19   WorkingDirectory = "@working_dir@"
20   PidDirectory = "@piddir@"
21   SubSysDirectory = "@subsysdir@"
22   Maximum Concurrent Jobs = 4
23   Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
24   Messages = Standard
25 }
26
27 JobDefs {
28   Name = "DefaultJob"
29   Type = Backup
30   Level = Incremental
31   Client = @hostname@-fd 
32   FileSet = FS_TESTJOB
33   Storage = File
34   Messages = Standard
35   Pool = Default
36   Priority = 10
37   Maximum Concurrent Jobs = 16
38 }
39
40 FileSet {
41  Name = FS_TESTJOB
42  Include {
43    File=<@tmpdir@/file-list
44  }
45 }
46
47 #dir: BeforeJob: run command "/bin/echo RunBeforeJob"
48 #fd: ClientRunBeforeJob: ClientRunBeforeJob
49 #fd: ClientAfterJob: run command "/bin/echo ClientRunAfterJob"
50 #dir: AfterJob: run command "/bin/echo RunAfterJob"
51
52 Job {
53   Name = "RUN_ALL_OK"
54   JobDefs = DefaultJob
55   FileSet = FS_TESTJOB
56   RunBeforeJob = "/bin/echo RunBeforeJob"
57   ClientRunBeforeJob = "/bin/echo ClientRunBeforeJob"
58   Run After Job = "/bin/echo RunAfterJob"
59   ClientRunAfterJob = "/bin/echo ClientRunAfterJob"
60   RunScript {
61     Command = "/bin/echo ClientRunBefore1"
62     Command = "/bin/echo ClientRunBefore2"
63     Command = "/bin/echo ClientRunBefore3"
64     Command = "/bin/echo ClientRunBefore4"
65     RunsWhen = Before
66   }
67 }
68
69 # first, you need to unzip win32/win32_runscript.zip to c:/temp
70 Job {
71   Name = "RUN_WIN32"
72   JobDefs = DefaultJob
73   FileSet = FS_TESTJOB
74   RunScript {                                              # 2.4 | 2.5 | cmd /c
75      Command = "c:\\temp\\test.bat"                        # ok  | ok  | ok
76      Command = "c:/temp/test.bat"                          # ok  | ok  | ok
77      Command = "c:/temp/test space.bat"                    # ok  | ok  | ok
78      Command = "\"c:/temp/dir space/test.bat\""            # ok  | ok  | ok
79      Command = "c:/temp/érïc/test.bat"                     # ERR | ok  | ok
80      Command = "c:/temp/érïc/test space.bat"               # ERR | ok  | ok
81      Command = "c:/temp/testé.bat"                         # ERR | ok  | ok
82      Command = "c:/temp/érïc/testé.bat"                    # ERR | ok  | ok
83      Command = "\"c:/temp/dir space/érïc/test.bat\""       # ERR | ERR | ok 
84      Command = "\"c:/temp/dir space/érïc/test space.bat\"" # ERR | ERR | ok 
85      Command = "c:/temp/dir space/érïc/test.bat"           # ERR | ERR | ERR 
86      Command = "c:/temp/dir space/test.bat"                # ERR | ERR | ERR
87      Command = "'c:/temp/dir space/test.bat'"              # ERR | ERR | ERR
88      Command = "\"c:/temp/éric space/test.bat\""           # ERR | ERR | ERR
89      Command = "c:/temp/éric space/test.bat"               # ERR | ERR | ERR
90      RunsWhen = Before
91      FailJobOnError = no
92   }
93 }
94
95 Job {
96   Name = "RUN_SUBST"
97   JobDefs = DefaultJob
98   FileSet = FS_TESTJOB
99   RunBeforeJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
100   ClientRunBeforeJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
101   ClientRunAfterJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
102   Run After Job = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t vol=%v status=%e"
103 }
104
105
106 #After job are after before job
107 Job {
108   Name = "RUN_DIR_FAILED_BUG"
109   FileSet = FS_TESTJOB  
110   JobDefs = DefaultJob
111   Run After Failed Job = "/bin/echo RunAfterFailedJob"
112   RunBeforeJob = "/bin/false"
113 }
114
115 #@hostname@-dir: BeforeJob: run command "/bin/false"
116 #@hostname@-dir: BeforeJob: RunAfterFailedJob
117 Job {
118   Name = "RUN_DIR_FAILED"
119   FileSet = FS_TESTJOB  
120   JobDefs = DefaultJob
121   RunBeforeJob = "/bin/false RUN_DIR_FAILED"
122   Run After Failed Job = "/bin/echo RunAfterFailedJob"
123 }
124
125 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"
126 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"
127 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED3"
128 #@hostname@-dir: AfterJob: run command "/bin/echo RunAfterFailedJob"
129 Job {
130   Name = "RUN_FD_FAILED"
131   FileSet = FS_TESTJOB  
132   JobDefs = DefaultJob
133   RunScript {
134     Command = "/bin/false RUN_FD_FAILED1"
135     Command = "/bin/false RUN_FD_FAILED2"
136     failjobonerror = no
137     RunsWhen = Before
138   }
139   RunScript {
140     Command = "/bin/false RUN_FD_FAILED3"
141     Command = "/bin/false RUN_FD_FAILED4"
142     failjobonerror = yes
143     RunsWhen = Before
144   }
145
146   Run After Failed Job = "/bin/echo RunAfterFailedJob"
147   RunScript {
148     Command = "/bin/echo touching @tmpdir@/RUN_FD_FAILED"
149     RunsWhen = after
150     RunsOnFailure = yes
151   }
152   RunScript {
153     Command = "/bin/touch @tmpdir@/RUN_FD_FAILED"
154     RunsWhen = after
155     RunsOnFailure = yes
156   }
157 }
158
159 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"
160 #we dont execute FAILED2 
161 #@hostname@-dir: AfterJob: run command "/bin/echo RunAfterFailedJob"
162 Job {
163   Name = "RUN_FD_FAILED2"
164   FileSet = FS_TESTJOB  
165   JobDefs = DefaultJob
166   RunScript {
167     Command = "/bin/false RUN_FD_FAILED1"
168     failjobonerror = yes
169     RunsWhen = Before
170   }
171   RunScript {
172     Command = "/bin/false RUN_FD_FAILED2"
173     failjobonerror = yes
174     RunsWhen = Before
175   }
176   RunScript {
177     Command = "/bin/false RUN_FD_FAILED3"
178     failjobonerror = yes
179     RunsOnFailure = yes
180     RunsWhen = Before
181   }
182
183   Run After Failed Job = "/bin/echo RunAfterFailedJob"
184 }
185
186 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_WARNING"
187 #Backup OK -- with warnings
188 Job {
189   Name = "RUN_FD_WARNING"
190   FileSet = FS_TESTJOB  
191   JobDefs = DefaultJob
192   RunScript {
193     Command = "/bin/false RUN_FD_WARNING"
194     failjobonerror = no
195     RunsWhen = Before
196   }
197   Run After Failed Job = "/bin/echo RunAfterFailedJob"
198 }
199
200 Job {
201   Name = "RUN_CONSOLE_CMD"
202   FileSet = FS_TESTJOB  
203   JobDefs = DefaultJob
204   RunScript {
205     Console = "purge volume=TestVolume001 yes"
206     Console = "st dir"
207     RunsWhen = Before
208     failjobonerror = no
209     runsonclient = no
210   }
211 }
212
213 Job { 
214   Name = "Restore" 
215   Type = Restore 
216   Client = @hostname@-fd 
217   FileSet = FS_TESTJOB
218   Storage = File
219   Messages = Standard
220   Pool = Default
221
222   RunScript  { 
223    RunsWhen = Before
224    RunsOnClient = Yes 
225    Command = "echo ClientBeforeRestore" 
226   } 
227
228   RunScript  { 
229    RunsOnFailure = No 
230    RunsWhen = After 
231    RunsOnClient = Yes 
232    Command = "echo ClientAfterRestore" 
233   } 
234
235   RunScript  { 
236    RunsWhen = Before
237    RunsOnClient = No
238    Command = "echo DirBeforeRestore" 
239   } 
240
241   RunScript  { 
242    RunsOnFailure = No 
243    RunsWhen = After 
244    RunsOnClient = Yes 
245    Command = "echo DirAfterRestore" 
246   } 
247
248
249 # Client (File Services) to backup
250 Client {
251   Name = @hostname@-fd
252   Address = @hostname@
253   FDPort = @fdport@
254   Catalog = MyCatalog
255   Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
256   File Retention = 30d                # 30 days
257   Job Retention = 180d                # six months
258   AutoPrune = yes                     # Prune expired Jobs/Files
259   Maximum Concurrent Jobs = 4
260 }
261
262 # Definiton of file storage device
263 Storage {
264   Name = File
265   Address = @hostname@                # N.B. Use a fully qualified name here
266   SDPort = @sdport@
267   Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
268   Device = FileStorage
269   Media Type = File
270   Maximum Concurrent Jobs = 4
271 }
272
273 # Generic catalog service
274 Catalog {
275   Name = MyCatalog
276   @libdbi@
277   dbname = @db_name@; user = @db_user@; password = "@db_password@"
278 }
279
280
281 Messages {
282   Name = Standard
283   console = all, !skipped, !saved
284   catalog = all, !skipped
285 }
286
287 # Default pool definition
288 Pool {
289   Name = Default
290   Pool Type = Backup
291   Recycle = yes                       # Bacula can automatically recycle Volumes
292   AutoPrune = yes                     # Prune expired volumes
293   Volume Retention = 365d             # one year
294 }