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