2 * Director specific configuration and defines
9 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
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
35 #define R_DIRECTOR 1001
38 #define R_STORAGE 1004
39 #define R_CATALOG 1005
40 #define R_SCHEDULE 1006
41 #define R_FILESET 1007
45 #define R_COUNTER 1011
47 #define R_LAST R_COUNTER
50 * Some resource attributes
53 #define R_ADDRESS 1021
54 #define R_PASSWORD 1022
59 /* Used for certain KeyWord tables */
65 /* Job Level keyword structure */
67 char *level_name; /* level keyword */
68 int level; /* level */
69 int job_type; /* JobType permitting this level */
72 /* Job Type keyword structure */
78 /* Definition of the contents of each Resource */
86 int DIRport; /* where we listen -- UA port server port */
87 char *DIRaddr; /* bind address */
88 char *password; /* Password for UA access */
89 char *query_file; /* SQL query file */
90 char *working_directory; /* WorkingDirectory */
91 char *pid_directory; /* PidDirectory */
92 char *subsys_directory; /* SubsysDirectory */
93 struct s_res_msgs *messages; /* Daemon message handler */
94 int MaxConcurrentJobs;
95 utime_t FDConnectTimeout; /* timeout for connect in seconds */
96 utime_t SDConnectTimeout; /* timeout in seconds */
98 typedef struct s_res_dir DIRRES;
104 struct s_res_client {
107 int FDport; /* Where File daemon listens */
108 int AutoPrune; /* Do automatic pruning? */
109 utime_t FileRetention; /* file retention period in seconds */
110 utime_t JobRetention; /* job retention period in seconds */
113 struct s_res_cat *catalog; /* Catalog resource */
115 typedef struct s_res_client CLIENT;
124 int SDport; /* port where Directors connect */
125 int SDDport; /* data port for File daemon */
130 int autochanger; /* set if autochanger */
132 typedef struct s_res_store STORE;
141 int DBport; /* Port -- not yet implemented */
147 typedef struct s_res_cat CAT;
156 int JobType; /* job type (backup, verify, restore */
157 int level; /* default backup/verify level */
158 int RestoreJobId; /* What -- JobId to restore */
159 char *RestoreWhere; /* Where on disk to restore -- directory */
160 char *RestoreBootstrap; /* Bootstrap file */
161 char *RunBeforeJob; /* Run program before Job */
162 char *RunAfterJob; /* Run program after Job */
163 char *WriteBootstrap; /* Where to write bootstrap Job updates */
164 int replace; /* How (overwrite, ..) */
165 utime_t MaxRunTime; /* max run time in seconds */
166 utime_t MaxStartDelay; /* max start delay in seconds */
167 int PruneJobs; /* Force pruning of Jobs */
168 int PruneFiles; /* Force pruning of Files */
169 int PruneVolumes; /* Force pruning of Volumes */
170 int SpoolAttributes; /* Set to spool attributes in SD */
172 struct s_res_msgs *messages; /* How and where to send messages */
173 struct s_res_sch *schedule; /* When -- Automatic schedule */
174 struct s_res_client *client; /* Who to backup */
175 struct s_res_fs *fileset; /* What to backup -- Fileset */
176 struct s_res_store *storage; /* Where is device -- Storage daemon */
177 struct s_res_pool *pool; /* Where is media -- Media Pool */
179 typedef struct s_res_job JOB;
188 char **include_array;
191 char **exclude_array;
194 int have_MD5; /* set if MD5 initialized */
195 struct MD5Context md5c; /* MD5 of include/exclude */
196 char MD5[50]; /* base 64 representation of MD5 */
198 typedef struct s_res_fs FILESET;
210 typedef struct s_res_sch SCHED;
213 * Group Resource (not used)
219 typedef struct s_res_group GROUP;
224 struct s_res_counter {
227 int32_t MinValue; /* Minimum value */
228 int32_t MaxValue; /* Maximum value */
229 int Global; /* global/local */
230 char *WrapCounter; /* Wrap counter name */
232 typedef struct s_res_counter COUNTER;
241 struct s_res_counter counter; /* Counter resources */
242 char *pool_type; /* Pool type */
243 char *label_format; /* Label format string */
244 int use_catalog; /* maintain catalog for media */
245 int catalog_files; /* maintain file entries in catalog */
246 int use_volume_once; /* write on volume only once */
247 int accept_any_volume; /* accept any volume */
248 uint32_t max_volumes; /* max number of volumes */
249 utime_t VolRetention; /* volume retention period in seconds */
250 utime_t VolUseDuration; /* duration volume can be used */
251 uint32_t MaxVolJobs; /* Maximum jobs on the Volume */
252 uint32_t MaxVolFiles; /* Maximum files on the Volume */
253 uint64_t MaxVolBytes; /* Maximum bytes on the Volume */
254 int AutoPrune; /* default for pool auto prune */
255 int Recycle; /* default for media recycle yes/no */
257 typedef struct s_res_pool POOL;
260 /* Define the Union of all the above
261 * resource structure definitions.
264 struct s_res_dir res_dir;
265 struct s_res_client res_client;
266 struct s_res_store res_store;
267 struct s_res_cat res_cat;
268 struct s_res_job res_job;
269 struct s_res_fs res_fs;
270 struct s_res_sch res_sch;
271 struct s_res_group res_group;
272 struct s_res_pool res_pool;
273 struct s_res_msgs res_msgs;
274 struct s_res_counter res_counter;
278 typedef union u_res URES;
281 /* Run structure contained in Schedule Resource */
283 struct s_run *next; /* points to next run record */
284 int level; /* level override */
286 POOL *pool; /* Pool override */
287 STORE *storage; /* Storage override */
288 MSGS *msgs; /* Messages override */
291 int minute; /* minute to run job */
292 time_t last_run; /* last time run */
293 time_t next_run; /* next time to run */
294 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
295 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
296 char month[nbytes_for_bits(12)]; /* bit set for each month */
297 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
299 typedef struct s_run RUN;