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
47 R_LAST = R_JOBDEFS /* keep this updated */
52 * Some resource attributes
63 /* Used for certain KeyWord tables */
69 /* Job Level keyword structure */
71 const char *level_name; /* level keyword */
72 int level; /* level */
73 int job_type; /* JobType permitting this level */
76 /* Job Type keyword structure */
78 const char *type_name;
82 /* Definition of the contents of each Resource */
83 /* Needed for forward references */
97 char *password; /* Password for UA access */
98 int enable_ssl; /* Use SSL for UA */
99 char *query_file; /* SQL query file */
100 char *working_directory; /* WorkingDirectory */
101 const char *scripts_directory; /* ScriptsDirectory */
102 char *pid_directory; /* PidDirectory */
103 char *subsys_directory; /* SubsysDirectory */
104 int require_ssl; /* Require SSL for all connections */
105 MSGS *messages; /* Daemon message handler */
106 uint32_t MaxConcurrentJobs; /* Max concurrent jobs for whole director */
107 utime_t FDConnectTimeout; /* timeout for connect in seconds */
108 utime_t SDConnectTimeout; /* timeout in seconds */
113 * Console ACL positions
125 Num_ACL /* keep last */
133 char *password; /* UA server password */
134 int enable_ssl; /* Use SSL */
135 alist *ACL_lists[Num_ACL]; /* pointers to ACLs */
146 int db_port; /* Port -- not yet implemented */
147 char *db_address; /* host name for remote access */
148 char *db_socket; /* Socket for local access */
152 int mult_db_connections; /* set if multiple connections wanted */
163 int FDport; /* Where File daemon listens */
164 int AutoPrune; /* Do automatic pruning? */
165 utime_t FileRetention; /* file retention period in seconds */
166 utime_t JobRetention; /* job retention period in seconds */
169 CAT *catalog; /* Catalog resource */
170 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
171 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
172 int enable_ssl; /* Use SSL */
182 int SDport; /* port where Directors connect */
183 int SDDport; /* data port for File daemon */
188 int autochanger; /* set if autochanger */
189 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
190 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
191 int enable_ssl; /* Use SSL */
195 #define MAX_STORE 2 /* Max storage directives in Job */
203 int JobType; /* job type (backup, verify, restore */
204 int JobLevel; /* default backup/verify level */
205 int Priority; /* Job priority */
206 int RestoreJobId; /* What -- JobId to restore */
207 char *RestoreWhere; /* Where on disk to restore -- directory */
208 char *RestoreBootstrap; /* Bootstrap file */
209 char *RunBeforeJob; /* Run program before Job */
210 char *RunAfterJob; /* Run program after Job */
211 char *RunAfterFailedJob; /* Run program after Job that errs */
212 char *ClientRunBeforeJob; /* Run client program before Job */
213 char *ClientRunAfterJob; /* Run client program after Job */
214 char *WriteBootstrap; /* Where to write bootstrap Job updates */
215 int replace; /* How (overwrite, ..) */
216 utime_t MaxRunTime; /* max run time in seconds */
217 utime_t MaxWaitTime; /* max blocking time in seconds */
218 utime_t MaxStartDelay; /* max start delay in seconds */
219 int PrefixLinks; /* prefix soft links with Where path */
220 int PruneJobs; /* Force pruning of Jobs */
221 int PruneFiles; /* Force pruning of Files */
222 int PruneVolumes; /* Force pruning of Volumes */
223 int SpoolAttributes; /* Set to spool attributes in SD */
224 int spool_data; /* Set to spool data in SD */
225 int rerun_failed_levels; /* Upgrade to rerun failed levels */
226 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
227 int RescheduleOnError; /* Set to reschedule on error */
228 int RescheduleTimes; /* Number of times to reschedule job */
229 utime_t RescheduleInterval; /* Reschedule interval */
230 utime_t JobRetention; /* job retention period in seconds */
231 bool write_part_after_job; /* Set to write part after job in SD */
233 MSGS *messages; /* How and where to send messages */
234 SCHED *schedule; /* When -- Automatic schedule */
235 CLIENT *client; /* Who to backup */
236 FILESET *fileset; /* What to backup -- Fileset */
237 alist *storage[MAX_STORE]; /* Where is device -- Storage daemon */
238 POOL *pool; /* Where is media -- Media Pool */
239 POOL *full_pool; /* Pool for Full backups */
240 POOL *inc_pool; /* Pool for Incremental backups */
241 POOL *dif_pool; /* Pool for Differental backups */
242 JOB *verify_job; /* Job name to verify */
243 JOB *jobdefs; /* Job defaults */
244 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
250 /* File options structure */
252 char opts[MAX_FOPTS]; /* options string */
253 alist regex; /* regex string(s) */
254 alist regexdir; /* regex string(s) for directories */
255 alist regexfile; /* regex string(s) for files */
256 alist wild; /* wild card strings */
257 alist wilddir; /* wild card strings for directories */
258 alist wildfile; /* wild card strings for files */
259 alist base; /* list of base names */
260 alist fstype; /* file system type limitation */
261 char *reader; /* reader program */
262 char *writer; /* writer program */
266 /* This is either an include item or an exclude item */
268 FOPTS *current_opts; /* points to current options structure */
269 FOPTS **opts_list; /* options list */
270 int num_opts; /* number of options items */
271 alist name_list; /* filename list -- holds char * */
281 bool new_include; /* Set if new include used */
282 INCEXE **include_items; /* array of incexe structures */
283 int num_includes; /* number in array */
284 INCEXE **exclude_items;
286 bool have_MD5; /* set if MD5 initialized */
287 struct MD5Context md5c; /* MD5 of include/exclude */
288 char MD5[30]; /* base 64 representation of MD5 */
289 int ignore_fs_changes; /* Don't force Full if FS changed */
309 int32_t MinValue; /* Minimum value */
310 int32_t MaxValue; /* Maximum value */
311 int32_t CurrentValue; /* Current value */
312 COUNTER *WrapCounter; /* Wrap counter name */
313 CAT *Catalog; /* Where to store */
314 bool created; /* Created in DB */
324 char *pool_type; /* Pool type */
325 char *label_format; /* Label format string */
326 char *cleaning_prefix; /* Cleaning label prefix */
327 int use_catalog; /* maintain catalog for media */
328 int catalog_files; /* maintain file entries in catalog */
329 int use_volume_once; /* write on volume only once */
330 int accept_any_volume; /* accept any volume */
331 int purge_oldest_volume; /* purge oldest volume */
332 int recycle_oldest_volume; /* attempt to recycle oldest volume */
333 int recycle_current_volume; /* attempt recycle of current volume */
334 uint32_t max_volumes; /* max number of volumes */
335 utime_t VolRetention; /* volume retention period in seconds */
336 utime_t VolUseDuration; /* duration volume can be used */
337 uint32_t MaxVolJobs; /* Maximum jobs on the Volume */
338 uint32_t MaxVolFiles; /* Maximum files on the Volume */
339 uint64_t MaxVolBytes; /* Maximum bytes on the Volume */
340 int AutoPrune; /* default for pool auto prune */
341 int Recycle; /* default for media recycle yes/no */
345 /* Define the Union of all the above
346 * resource structure definitions.
365 /* Run structure contained in Schedule Resource */
367 RUN *next; /* points to next run record */
368 int level; /* level override */
369 int Priority; /* priority override */
371 bool spool_data; /* Data spooling override */
372 bool spool_data_set; /* Data spooling override given */
373 bool write_part_after_job; /* Write part after job override */
374 bool write_part_after_job_set; /* Write part after job override given */
376 POOL *pool; /* Pool override */
377 POOL *full_pool; /* Pool override */
378 POOL *inc_pool; /* Pool override */
379 POOL *dif_pool; /* Pool override */
380 STORE *storage; /* Storage override */
381 MSGS *msgs; /* Messages override */
384 int minute; /* minute to run job */
385 time_t last_run; /* last time run */
386 time_t next_run; /* next time to run */
387 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
388 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
389 char month[nbytes_for_bits(12)]; /* bit set for each month */
390 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
391 char wom[nbytes_for_bits(5)]; /* week of month */
392 char woy[nbytes_for_bits(54)]; /* week of year */