2 * Director specific configuration and defines
9 Copyright (C) 2000-2005 Kern Sibbald
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of
14 the License, or (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public
22 License along with this program; if not, write to the Free
23 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
28 /* NOTE: #includes at the end of this file */
31 * Resource codes -- they must be sequential for indexing
48 R_LAST = R_DEVICE /* keep this updated */
53 * Some resource attributes
64 /* Used for certain KeyWord tables */
70 /* Job Level keyword structure */
72 const char *level_name; /* level keyword */
73 int level; /* level */
74 int job_type; /* JobType permitting this level */
77 /* Job Type keyword structure */
79 const char *type_name;
83 /* Definition of the contents of each Resource */
84 /* Needed for forward references */
100 char *password; /* Password for UA access */
101 int enable_ssl; /* Use SSL for UA */
102 char *query_file; /* SQL query file */
103 char *working_directory; /* WorkingDirectory */
104 const char *scripts_directory; /* ScriptsDirectory */
105 char *pid_directory; /* PidDirectory */
106 char *subsys_directory; /* SubsysDirectory */
107 int require_ssl; /* Require SSL for all connections */
108 MSGS *messages; /* Daemon message handler */
109 uint32_t MaxConcurrentJobs; /* Max concurrent jobs for whole director */
110 utime_t FDConnectTimeout; /* timeout for connect in seconds */
111 utime_t SDConnectTimeout; /* timeout in seconds */
116 * This resource is a bit different from the other resources
117 * because it is not defined in the Director
118 * by DEVICE { ... }, but rather by a "reference" such as
119 * DEVICE = xxx; Then when the Director connects to the
120 * SD, it requests the information about the device.
126 bool found; /* found with SD */
127 int num_writers; /* number of writers */
128 int max_writers; /* = 1 for files */
129 int reserved; /* number of reserves */
130 int num_drives; /* for autochanger */
131 bool autochanger; /* set if device is autochanger */
132 bool open; /* drive open */
133 bool append; /* in append mode */
134 bool read; /* in read mode */
135 bool labeled; /* Volume name valid */
136 bool offline; /* not available */
137 bool autoselect; /* can be selected via autochanger */
139 char ChangerName[MAX_NAME_LENGTH];
140 char VolumeName[MAX_NAME_LENGTH];
141 char MediaType[MAX_NAME_LENGTH];
145 * Console ACL positions
157 Num_ACL /* keep last */
166 char *password; /* UA server password */
167 int enable_ssl; /* Use SSL */
168 alist *ACL_lists[Num_ACL]; /* pointers to ACLs */
180 int db_port; /* Port -- not yet implemented */
181 char *db_address; /* host name for remote access */
182 char *db_socket; /* Socket for local access */
186 int mult_db_connections; /* set if multiple connections wanted */
198 int FDport; /* Where File daemon listens */
199 int AutoPrune; /* Do automatic pruning? */
200 utime_t FileRetention; /* file retention period in seconds */
201 utime_t JobRetention; /* job retention period in seconds */
204 CAT *catalog; /* Catalog resource */
205 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
206 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
207 int enable_ssl; /* Use SSL */
218 int SDport; /* port where Directors connect */
219 int SDDport; /* data port for File daemon */
223 alist *device; /* Alternate devices for this Storage */
224 int autochanger; /* set if autochanger */
225 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
226 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
227 int enable_ssl; /* Use SSL */
229 int64_t StorageId; /* Set from Storage DB record */
232 char *dev_name() const;
236 inline char *STORE::dev_name() const
238 DEVICE *dev = (DEVICE *)device->first();
239 return dev->hdr.name;
242 inline char *STORE::name() const { return hdr.name; }
252 int JobType; /* job type (backup, verify, restore */
253 int JobLevel; /* default backup/verify level */
254 int Priority; /* Job priority */
255 int RestoreJobId; /* What -- JobId to restore */
256 char *RestoreWhere; /* Where on disk to restore -- directory */
257 char *RestoreBootstrap; /* Bootstrap file */
258 char *RunBeforeJob; /* Run program before Job */
259 char *RunAfterJob; /* Run program after Job */
260 char *RunAfterFailedJob; /* Run program after Job that errs */
261 char *ClientRunBeforeJob; /* Run client program before Job */
262 char *ClientRunAfterJob; /* Run client program after Job */
263 char *WriteBootstrap; /* Where to write bootstrap Job updates */
264 int replace; /* How (overwrite, ..) */
265 utime_t MaxRunTime; /* max run time in seconds */
266 utime_t MaxWaitTime; /* max blocking time in seconds */
267 utime_t FullMaxWaitTime; /* Max Full job wait time */
268 utime_t DiffMaxWaitTime; /* Max Differential job wait time */
269 utime_t IncMaxWaitTime; /* Max Incremental job wait time */
270 utime_t MaxStartDelay; /* max start delay in seconds */
271 int PrefixLinks; /* prefix soft links with Where path */
272 int PruneJobs; /* Force pruning of Jobs */
273 int PruneFiles; /* Force pruning of Files */
274 int PruneVolumes; /* Force pruning of Volumes */
275 int SpoolAttributes; /* Set to spool attributes in SD */
276 int spool_data; /* Set to spool data in SD */
277 int rerun_failed_levels; /* Upgrade to rerun failed levels */
278 int NewVolEachJob; /* Mount new volume each Job */
279 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
280 int RescheduleOnError; /* Set to reschedule on error */
281 int RescheduleTimes; /* Number of times to reschedule job */
282 utime_t RescheduleInterval; /* Reschedule interval */
283 utime_t JobRetention; /* job retention period in seconds */
284 bool write_part_after_job; /* Set to write part after job in SD */
286 MSGS *messages; /* How and where to send messages */
287 SCHED *schedule; /* When -- Automatic schedule */
288 CLIENT *client; /* Who to backup */
289 FILESET *fileset; /* What to backup -- Fileset */
290 alist *storage; /* Where is device -- list of Storage to be used */
291 POOL *pool; /* Where is media -- Media Pool */
292 POOL *full_pool; /* Pool for Full backups */
293 POOL *inc_pool; /* Pool for Incremental backups */
294 POOL *dif_pool; /* Pool for Differental backups */
295 JOB *verify_job; /* Job name to verify */
296 JOB *jobdefs; /* Job defaults */
297 alist *run_cmds; /* Run commands */
298 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
304 /* File options structure */
306 char opts[MAX_FOPTS]; /* options string */
307 alist regex; /* regex string(s) */
308 alist regexdir; /* regex string(s) for directories */
309 alist regexfile; /* regex string(s) for files */
310 alist wild; /* wild card strings */
311 alist wilddir; /* wild card strings for directories */
312 alist wildfile; /* wild card strings for files */
313 alist base; /* list of base names */
314 alist fstype; /* file system type limitation */
315 char *reader; /* reader program */
316 char *writer; /* writer program */
320 /* This is either an include item or an exclude item */
322 FOPTS *current_opts; /* points to current options structure */
323 FOPTS **opts_list; /* options list */
324 int num_opts; /* number of options items */
325 alist name_list; /* filename list -- holds char * */
336 bool new_include; /* Set if new include used */
337 INCEXE **include_items; /* array of incexe structures */
338 int num_includes; /* number in array */
339 INCEXE **exclude_items;
341 bool have_MD5; /* set if MD5 initialized */
342 struct MD5Context md5c; /* MD5 of include/exclude */
343 char MD5[30]; /* base 64 representation of MD5 */
344 int ignore_fs_changes; /* Don't force Full if FS changed */
366 int32_t MinValue; /* Minimum value */
367 int32_t MaxValue; /* Maximum value */
368 int32_t CurrentValue; /* Current value */
369 COUNTER *WrapCounter; /* Wrap counter name */
370 CAT *Catalog; /* Where to store */
371 bool created; /* Created in DB */
382 char *pool_type; /* Pool type */
383 char *label_format; /* Label format string */
384 char *cleaning_prefix; /* Cleaning label prefix */
385 int LabelType; /* Bacula/ANSI/IBM label type */
386 int use_catalog; /* maintain catalog for media */
387 int catalog_files; /* maintain file entries in catalog */
388 int use_volume_once; /* write on volume only once */
389 int accept_any_volume; /* accept any volume */
390 int purge_oldest_volume; /* purge oldest volume */
391 int recycle_oldest_volume; /* attempt to recycle oldest volume */
392 int recycle_current_volume; /* attempt recycle of current volume */
393 uint32_t max_volumes; /* max number of volumes */
394 utime_t VolRetention; /* volume retention period in seconds */
395 utime_t VolUseDuration; /* duration volume can be used */
396 uint32_t MaxVolJobs; /* Maximum jobs on the Volume */
397 uint32_t MaxVolFiles; /* Maximum files on the Volume */
398 uint64_t MaxVolBytes; /* Maximum bytes on the Volume */
399 int AutoPrune; /* default for pool auto prune */
400 int Recycle; /* default for media recycle yes/no */
406 /* Define the Union of all the above
407 * resource structure definitions.
427 /* Run structure contained in Schedule Resource */
430 RUN *next; /* points to next run record */
431 int level; /* level override */
432 int Priority; /* priority override */
434 bool spool_data; /* Data spooling override */
435 bool spool_data_set; /* Data spooling override given */
436 bool write_part_after_job; /* Write part after job override */
437 bool write_part_after_job_set; /* Write part after job override given */
439 POOL *pool; /* Pool override */
440 POOL *full_pool; /* Pool override */
441 POOL *inc_pool; /* Pool override */
442 POOL *dif_pool; /* Pool override */
443 STORE *storage; /* Storage override */
444 MSGS *msgs; /* Messages override */
447 int minute; /* minute to run job */
448 time_t last_run; /* last time run */
449 time_t next_run; /* next time to run */
450 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
451 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
452 char month[nbytes_for_bits(12)]; /* bit set for each month */
453 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
454 char wom[nbytes_for_bits(5)]; /* week of month */
455 char woy[nbytes_for_bits(54)]; /* week of year */