2 * Director specific configuration and defines
9 Copyright (C) 2000-2006 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
13 version 2 as amended with additional clauses defined in the
14 file LICENSE in the main source directory.
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
19 the file LICENSE for additional details.
23 /* NOTE: #includes at the end of this file */
26 * Resource codes -- they must be sequential for indexing
43 R_LAST = R_DEVICE /* keep this updated */
48 * Some resource attributes
59 /* Used for certain KeyWord tables */
65 /* Job Level keyword structure */
67 const char *level_name; /* level keyword */
68 int level; /* level */
69 int job_type; /* JobType permitting this level */
72 /* Job Type keyword structure */
74 const char *type_name;
78 /* Definition of the contents of each Resource */
79 /* Needed for forward references */
96 char *password; /* Password for UA access */
97 char *query_file; /* SQL query file */
98 char *working_directory; /* WorkingDirectory */
99 const char *scripts_directory; /* ScriptsDirectory */
100 char *pid_directory; /* PidDirectory */
101 char *subsys_directory; /* SubsysDirectory */
102 MSGS *messages; /* Daemon message handler */
103 uint32_t MaxConcurrentJobs; /* Max concurrent jobs for whole director */
104 utime_t FDConnectTimeout; /* timeout for connect in seconds */
105 utime_t SDConnectTimeout; /* timeout in seconds */
106 char *tls_ca_certfile; /* TLS CA Certificate File */
107 char *tls_ca_certdir; /* TLS CA Certificate Directory */
108 char *tls_certfile; /* TLS Server Certificate File */
109 char *tls_keyfile; /* TLS Server Key File */
110 char *tls_dhfile; /* TLS Diffie-Hellman Parameters */
111 alist *tls_allowed_cns; /* TLS Allowed Clients */
112 TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
113 bool tls_enable; /* Enable TLS */
114 bool tls_require; /* Require TLS */
115 bool tls_verify_peer; /* TLS Verify Client Certificate */
121 inline char *DIRRES::name() const { return hdr.name; }
125 * This resource is a bit different from the other resources
126 * because it is not defined in the Director
127 * by DEVICE { ... }, but rather by a "reference" such as
128 * DEVICE = xxx; Then when the Director connects to the
129 * SD, it requests the information about the device.
135 bool found; /* found with SD */
136 int num_writers; /* number of writers */
137 int max_writers; /* = 1 for files */
138 int reserved; /* number of reserves */
139 int num_drives; /* for autochanger */
140 bool autochanger; /* set if device is autochanger */
141 bool open; /* drive open */
142 bool append; /* in append mode */
143 bool read; /* in read mode */
144 bool labeled; /* Volume name valid */
145 bool offline; /* not available */
146 bool autoselect; /* can be selected via autochanger */
148 char ChangerName[MAX_NAME_LENGTH];
149 char VolumeName[MAX_NAME_LENGTH];
150 char MediaType[MAX_NAME_LENGTH];
156 inline char *DEVICE::name() const { return hdr.name; }
159 * Console ACL positions
171 Num_ACL /* keep last */
180 char *password; /* UA server password */
181 alist *ACL_lists[Num_ACL]; /* pointers to ACLs */
182 char *tls_ca_certfile; /* TLS CA Certificate File */
183 char *tls_ca_certdir; /* TLS CA Certificate Directory */
184 char *tls_certfile; /* TLS Server Certificate File */
185 char *tls_keyfile; /* TLS Server Key File */
186 char *tls_dhfile; /* TLS Diffie-Hellman Parameters */
187 alist *tls_allowed_cns; /* TLS Allowed Clients */
188 TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
189 bool tls_enable; /* Enable TLS */
190 bool tls_require; /* Require TLS */
191 bool tls_verify_peer; /* TLS Verify Client Certificate */
197 inline char *CONRES::name() const { return hdr.name; }
208 int db_port; /* Port */
209 char *db_address; /* host name for remote access */
210 char *db_socket; /* Socket for local access */
214 int mult_db_connections; /* set if multiple connections wanted */
220 inline char *CAT::name() const { return hdr.name; }
231 int FDport; /* Where File daemon listens */
232 utime_t FileRetention; /* file retention period in seconds */
233 utime_t JobRetention; /* job retention period in seconds */
236 CAT *catalog; /* Catalog resource */
237 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
238 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
239 char *tls_ca_certfile; /* TLS CA Certificate File */
240 char *tls_ca_certdir; /* TLS CA Certificate Directory */
241 char *tls_certfile; /* TLS Client Certificate File */
242 char *tls_keyfile; /* TLS Client Key File */
243 TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
244 bool tls_enable; /* Enable TLS */
245 bool tls_require; /* Require TLS */
246 bool AutoPrune; /* Do automatic pruning? */
252 inline char *CLIENT::name() const { return hdr.name; }
263 int SDport; /* port where Directors connect */
264 int SDDport; /* data port for File daemon */
268 alist *device; /* Alternate devices for this Storage */
269 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
270 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
271 char *tls_ca_certfile; /* TLS CA Certificate File */
272 char *tls_ca_certdir; /* TLS CA Certificate Directory */
273 char *tls_certfile; /* TLS Client Certificate File */
274 char *tls_keyfile; /* TLS Client Key File */
275 TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
276 bool tls_enable; /* Enable TLS */
277 bool tls_require; /* Require TLS */
278 bool enabled; /* Set if device is enabled */
279 bool autochanger; /* set if autochanger */
280 int64_t StorageId; /* Set from Storage DB record */
281 int drives; /* number of drives in autochanger */
284 char *dev_name() const;
288 inline char *STORE::dev_name() const
290 DEVICE *dev = (DEVICE *)device->first();
291 return dev->hdr.name;
294 inline char *STORE::name() const { return hdr.name; }
304 int JobType; /* job type (backup, verify, restore */
305 int JobLevel; /* default backup/verify level */
306 int Priority; /* Job priority */
307 int RestoreJobId; /* What -- JobId to restore */
308 char *RestoreWhere; /* Where on disk to restore -- directory */
309 char *RestoreBootstrap; /* Bootstrap file */
310 alist *RunScripts; /* Run {client} program {after|before} Job */
312 char *WriteBootstrap; /* Where to write bootstrap Job updates */
313 char *WriteVerifyList; /* List of changed files */
315 int replace; /* How (overwrite, ..) */
316 utime_t MaxRunTime; /* max run time in seconds */
317 utime_t MaxWaitTime; /* max blocking time in seconds */
318 utime_t FullMaxWaitTime; /* Max Full job wait time */
319 utime_t DiffMaxWaitTime; /* Max Differential job wait time */
320 utime_t IncMaxWaitTime; /* Max Incremental job wait time */
321 utime_t MaxStartDelay; /* max start delay in seconds */
322 utime_t RescheduleInterval; /* Reschedule interval */
323 utime_t JobRetention; /* job retention period in seconds */
324 uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
325 int RescheduleTimes; /* Number of times to reschedule job */
326 bool RescheduleOnError; /* Set to reschedule on error */
327 bool PrefixLinks; /* prefix soft links with Where path */
328 bool PruneJobs; /* Force pruning of Jobs */
329 bool PruneFiles; /* Force pruning of Files */
330 bool PruneVolumes; /* Force pruning of Volumes */
331 bool SpoolAttributes; /* Set to spool attributes in SD */
332 bool spool_data; /* Set to spool data in SD */
333 bool rerun_failed_levels; /* Upgrade to rerun failed levels */
334 bool PreferMountedVolumes; /* Prefer vols mounted rather than new one */
335 bool write_part_after_job; /* Set to write part after job in SD */
336 bool enabled; /* Set if job enabled */
338 MSGS *messages; /* How and where to send messages */
339 SCHED *schedule; /* When -- Automatic schedule */
340 CLIENT *client; /* Who to backup */
341 FILESET *fileset; /* What to backup -- Fileset */
342 alist *storage; /* Where is device -- list of Storage to be used */
343 POOL *pool; /* Where is media -- Media Pool */
344 POOL *full_pool; /* Pool for Full backups */
345 POOL *inc_pool; /* Pool for Incremental backups */
346 POOL *diff_pool; /* Pool for Differental backups */
347 POOL *next_pool; /* Next Pool for Migration */
348 char *selection_pattern;
351 JOB *verify_job; /* Job name to verify */
353 JOB *jobdefs; /* Job defaults */
354 alist *run_cmds; /* Run commands */
355 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
361 inline char *JOB::name() const { return hdr.name; }
366 /* File options structure */
368 char opts[MAX_FOPTS]; /* options string */
369 alist regex; /* regex string(s) */
370 alist regexdir; /* regex string(s) for directories */
371 alist regexfile; /* regex string(s) for files */
372 alist wild; /* wild card strings */
373 alist wilddir; /* wild card strings for directories */
374 alist wildfile; /* wild card strings for files */
375 alist base; /* list of base names */
376 alist fstype; /* file system type limitation */
377 char *reader; /* reader program */
378 char *writer; /* writer program */
382 /* This is either an include item or an exclude item */
384 FOPTS *current_opts; /* points to current options structure */
385 FOPTS **opts_list; /* options list */
386 int num_opts; /* number of options items */
387 alist name_list; /* filename list -- holds char * */
398 bool new_include; /* Set if new include used */
399 INCEXE **include_items; /* array of incexe structures */
400 int num_includes; /* number in array */
401 INCEXE **exclude_items;
403 bool have_MD5; /* set if MD5 initialized */
404 struct MD5Context md5c; /* MD5 of include/exclude */
405 char MD5[30]; /* base 64 representation of MD5 */
406 bool ignore_fs_changes; /* Don't force Full if FS changed */
407 bool enable_vss; /* Enable Volume Shadow Copy */
413 inline char *FILESET::name() const { return hdr.name; }
433 int32_t MinValue; /* Minimum value */
434 int32_t MaxValue; /* Maximum value */
435 int32_t CurrentValue; /* Current value */
436 COUNTER *WrapCounter; /* Wrap counter name */
437 CAT *Catalog; /* Where to store */
438 bool created; /* Created in DB */
443 inline char *COUNTER::name() const { return hdr.name; }
453 char *pool_type; /* Pool type */
454 char *label_format; /* Label format string */
455 char *cleaning_prefix; /* Cleaning label prefix */
456 int32_t LabelType; /* Bacula/ANSI/IBM label type */
457 uint32_t max_volumes; /* max number of volumes */
458 utime_t VolRetention; /* volume retention period in seconds */
459 utime_t VolUseDuration; /* duration volume can be used */
460 uint32_t MaxVolJobs; /* Maximum jobs on the Volume */
461 uint32_t MaxVolFiles; /* Maximum files on the Volume */
462 uint64_t MaxVolBytes; /* Maximum bytes on the Volume */
463 utime_t MigrationTime; /* Time to migrate to next pool */
464 uint32_t MigrationHighBytes; /* When migration starts */
465 uint32_t MigrationLowBytes; /* When migration stops */
466 POOL *NextPool; /* Next pool for migration */
467 alist *storage; /* Where is device -- list of Storage to be used */
468 bool use_catalog; /* maintain catalog for media */
469 bool catalog_files; /* maintain file entries in catalog */
470 bool use_volume_once; /* write on volume only once */
471 bool purge_oldest_volume; /* purge oldest volume */
472 bool recycle_oldest_volume; /* attempt to recycle oldest volume */
473 bool recycle_current_volume; /* attempt recycle of current volume */
474 bool AutoPrune; /* default for pool auto prune */
475 bool Recycle; /* default for media recycle yes/no */
481 inline char *POOL::name() const { return hdr.name; }
486 /* Define the Union of all the above
487 * resource structure definitions.
503 RUNSCRIPT res_runscript;
508 /* Run structure contained in Schedule Resource */
511 RUN *next; /* points to next run record */
512 int level; /* level override */
513 int Priority; /* priority override */
515 bool spool_data; /* Data spooling override */
516 bool spool_data_set; /* Data spooling override given */
517 bool write_part_after_job; /* Write part after job override */
518 bool write_part_after_job_set; /* Write part after job override given */
520 POOL *pool; /* Pool override */
521 POOL *full_pool; /* Pool override */
522 POOL *inc_pool; /* Pool override */
523 POOL *diff_pool; /* Pool override */
524 STORE *storage; /* Storage override */
525 MSGS *msgs; /* Messages override */
528 int minute; /* minute to run job */
529 time_t last_run; /* last time run */
530 time_t next_run; /* next time to run */
531 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
532 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
533 char month[nbytes_for_bits(12)]; /* bit set for each month */
534 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
535 char wom[nbytes_for_bits(5)]; /* week of month */
536 char woy[nbytes_for_bits(54)]; /* week of year */