]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/bacula-dir.conf.testrunscript.in
regress: Allow to use value with spaces in add_attribute()
[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 arg1"                   # ok  | ok  | ok
77      Command = "c:/temp/test.bat"                          # ok  | ok  | ok
78      Command = "c:/temp/test.bat arg1"                     # ok  | ok  | ok
79      Command = "c:/temp/test space.bat"                    # ok  | ok  | ok
80      Command = "c:/temp/test2 space.bat"                   # ok  | ok  | ok
81      Command = "\"c:/temp/test space.bat\" arg1"           # ok  | ok  | ok
82      Command = "\"c:/temp/dir space/test.bat\" arg1"       # ok  | ok  | ok
83      Command = "c:/temp/érïc/test.bat"                     # ERR | ok  | ok
84      Command = "c:/temp/érïc/test space.bat"               # ERR | ok  | ok
85      Command = "c:/temp/testé.bat"                         # ERR | ok  | ok
86      Command = "c:/temp/érïc/testé.bat"                    # ERR | ok  | ok
87      Command = "\"c:/temp/dir space/érïc/test.bat\""       # ERR | ERR | ok 
88      Command = "\"c:/temp/dir space/érïc/test space.bat\"" # ERR | ERR | ok 
89      Command = "c:/temp/test space.bat arg1"               # ERR | ERR | ERR
90      Command = "c:/temp/test2 space.bat arg1"              # ERR | ERR | ERR
91      Command = "c:/temp/dir space/érïc/test.bat"           # ERR | ERR | ERR 
92      Command = "c:/temp/dir space/test.bat"                # ERR | ERR | ERR
93      Command = "'c:/temp/dir space/test.bat'"              # ERR | ERR | ERR
94      Command = "\"c:/temp/éric space/test.bat\""           # ERR | ERR | ERR
95      Command = "c:/temp/éric space/test.bat"               # ERR | ERR | ERR
96      RunsWhen = Before
97      FailJobOnError = no
98   }
99 }
100
101 Job {
102   Name = "RUN_SUBST"
103   JobDefs = DefaultJob
104   FileSet = FS_TESTJOB
105   RunBeforeJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
106   ClientRunBeforeJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
107   ClientRunAfterJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
108   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"
109 }
110
111
112 #After job are after before job
113 Job {
114   Name = "RUN_DIR_FAILED_BUG"
115   FileSet = FS_TESTJOB  
116   JobDefs = DefaultJob
117   Run After Failed Job = "/bin/echo RunAfterFailedJob"
118   RunBeforeJob = "/bin/false"
119 }
120
121 #@hostname@-dir: BeforeJob: run command "/bin/false"
122 #@hostname@-dir: BeforeJob: RunAfterFailedJob
123 Job {
124   Name = "RUN_DIR_FAILED"
125   FileSet = FS_TESTJOB  
126   JobDefs = DefaultJob
127   RunBeforeJob = "/bin/false RUN_DIR_FAILED"
128   Run After Failed Job = "/bin/echo RunAfterFailedJob"
129 }
130
131 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"
132 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"
133 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED3"
134 #@hostname@-dir: AfterJob: run command "/bin/echo RunAfterFailedJob"
135 Job {
136   Name = "RUN_FD_FAILED"
137   FileSet = FS_TESTJOB  
138   JobDefs = DefaultJob
139   RunScript {
140     Command = "/bin/false RUN_FD_FAILED1"
141     Command = "/bin/false RUN_FD_FAILED2"
142     failjobonerror = no
143     RunsWhen = Before
144   }
145   RunScript {
146     Command = "/bin/false RUN_FD_FAILED3"
147     Command = "/bin/false RUN_FD_FAILED4"
148     failjobonerror = yes
149     RunsWhen = Before
150   }
151
152   Run After Failed Job = "/bin/echo RunAfterFailedJob"
153   RunScript {
154     Command = "/bin/echo touching @tmpdir@/RUN_FD_FAILED"
155     RunsWhen = after
156     RunsOnFailure = yes
157   }
158   RunScript {
159     Command = "/bin/touch @tmpdir@/RUN_FD_FAILED"
160     RunsWhen = after
161     RunsOnFailure = yes
162   }
163 }
164
165 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"
166 #we don't execute FAILED2 
167 #@hostname@-dir: AfterJob: run command "/bin/echo RunAfterFailedJob"
168 Job {
169   Name = "RUN_FD_FAILED2"
170   FileSet = FS_TESTJOB  
171   JobDefs = DefaultJob
172   RunScript {
173     Command = "/bin/false RUN_FD_FAILED1"
174     failjobonerror = yes
175     RunsWhen = Before
176   }
177   RunScript {
178     Command = "/bin/false RUN_FD_FAILED2"
179     failjobonerror = yes
180     RunsWhen = Before
181   }
182   RunScript {
183     Command = "/bin/false RUN_FD_FAILED3"
184     failjobonerror = yes
185     RunsOnFailure = yes
186     RunsWhen = Before
187   }
188
189   Run After Failed Job = "/bin/echo RunAfterFailedJob"
190 }
191
192 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_WARNING"
193 #Backup OK -- with warnings
194 Job {
195   Name = "RUN_FD_WARNING"
196   FileSet = FS_TESTJOB  
197   JobDefs = DefaultJob
198   RunScript {
199     Command = "/bin/false RUN_FD_WARNING"
200     failjobonerror = no
201     RunsWhen = Before
202   }
203   Run After Failed Job = "/bin/echo RunAfterFailedJob"
204 }
205
206 Job {
207   Name = "RUN_CONSOLE_CMD"
208   FileSet = FS_TESTJOB  
209   JobDefs = DefaultJob
210   RunScript {
211     Console = "purge volume=TestVolume001 yes"
212     Console = "st dir"
213     RunsWhen = Before
214     failjobonerror = no
215     runsonclient = no
216   }
217 }
218
219 Job { 
220   Name = "Restore" 
221   Type = Restore 
222   Client = @hostname@-fd 
223   FileSet = FS_TESTJOB
224   Storage = File
225   Messages = Standard
226   Pool = Default
227
228   RunScript  { 
229    RunsWhen = Before
230    RunsOnClient = Yes 
231    Command = "echo ClientBeforeRestore" 
232   } 
233
234   RunScript  { 
235    RunsOnFailure = No 
236    RunsWhen = After 
237    RunsOnClient = Yes 
238    Command = "echo ClientAfterRestore" 
239   } 
240
241   RunScript  { 
242    RunsWhen = Before
243    RunsOnClient = No
244    Command = "echo DirBeforeRestore" 
245   } 
246
247   RunScript  { 
248    RunsOnFailure = No 
249    RunsWhen = After 
250    RunsOnClient = Yes 
251    Command = "echo DirAfterRestore" 
252   } 
253
254
255 # Client (File Services) to backup
256 Client {
257   Name = @hostname@-fd
258   Address = @hostname@
259   FDPort = @fdport@
260   Catalog = MyCatalog
261   Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
262   File Retention = 30d                # 30 days
263   Job Retention = 180d                # six months
264   AutoPrune = yes                     # Prune expired Jobs/Files
265   Maximum Concurrent Jobs = 4
266 }
267
268 # Definiton of file storage device
269 Storage {
270   Name = File
271   Address = @hostname@                # N.B. Use a fully qualified name here
272   SDPort = @sdport@
273   Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
274   Device = FileStorage
275   Media Type = File
276   Maximum Concurrent Jobs = 4
277 }
278
279 # Generic catalog service
280 Catalog {
281   Name = MyCatalog
282   @libdbi@
283   dbname = @db_name@; user = @db_user@; password = "@db_password@"
284 }
285
286
287 Messages {
288   Name = Standard
289   console = all, !skipped, !saved
290   catalog = all, !skipped
291 }
292
293 # Default pool definition
294 Pool {
295   Name = Default
296   Pool Type = Backup
297   Recycle = yes                       # Bacula can automatically recycle Volumes
298   AutoPrune = yes                     # Prune expired volumes
299   Volume Retention = 365d             # one year
300 }