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