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
46 #define R_FILEOPTIONS 1012
48 #define R_LAST R_FILEOPTIONS
51 * Some resource attributes
54 #define R_ADDRESS 1021
55 #define R_PASSWORD 1022
60 /* Used for certain KeyWord tables */
66 /* Job Level keyword structure */
68 char *level_name; /* level keyword */
69 int level; /* level */
70 int job_type; /* JobType permitting this level */
73 /* Job Type keyword structure */
79 /* Definition of the contents of each Resource */
87 int DIRport; /* where we listen -- UA port server port */
88 char *DIRaddr; /* bind address */
89 char *password; /* Password for UA access */
90 char *query_file; /* SQL query file */
91 char *working_directory; /* WorkingDirectory */
92 char *pid_directory; /* PidDirectory */
93 char *subsys_directory; /* SubsysDirectory */
94 struct s_res_msgs *messages; /* Daemon message handler */
95 int MaxConcurrentJobs;
96 utime_t FDConnectTimeout; /* timeout for connect in seconds */
97 utime_t SDConnectTimeout; /* timeout in seconds */
99 typedef struct s_res_dir DIRRES;
105 struct s_res_client {
108 int FDport; /* Where File daemon listens */
109 int AutoPrune; /* Do automatic pruning? */
110 utime_t FileRetention; /* file retention period in seconds */
111 utime_t JobRetention; /* job retention period in seconds */
114 struct s_res_cat *catalog; /* Catalog resource */
116 typedef struct s_res_client CLIENT;
125 int SDport; /* port where Directors connect */
126 int SDDport; /* data port for File daemon */
131 int autochanger; /* set if autochanger */
133 typedef struct s_res_store STORE;
142 int DBport; /* Port -- not yet implemented */
148 typedef struct s_res_cat CAT;
157 int JobType; /* job type (backup, verify, restore */
158 int level; /* default backup/verify level */
159 int RestoreJobId; /* What -- JobId to restore */
160 char *RestoreWhere; /* Where on disk to restore -- directory */
161 char *RestoreBootstrap; /* Bootstrap file */
162 char *RunBeforeJob; /* Run program before Job */
163 char *RunAfterJob; /* Run program after Job */
164 char *WriteBootstrap; /* Where to write bootstrap Job updates */
165 int replace; /* How (overwrite, ..) */
166 utime_t MaxRunTime; /* max run time in seconds */
167 utime_t MaxStartDelay; /* max start delay in seconds */
168 int PruneJobs; /* Force pruning of Jobs */
169 int PruneFiles; /* Force pruning of Files */
170 int PruneVolumes; /* Force pruning of Volumes */
171 int SpoolAttributes; /* Set to spool attributes in SD */
173 struct s_res_msgs *messages; /* How and where to send messages */
174 struct s_res_sch *schedule; /* When -- Automatic schedule */
175 struct s_res_client *client; /* Who to backup */
176 struct s_res_fs *fileset; /* What to backup -- Fileset */
177 struct s_res_store *storage; /* Where is device -- Storage daemon */
178 struct s_res_pool *pool; /* Where is media -- Media Pool */
180 typedef struct s_res_job JOB;
189 char **include_array;
192 char **exclude_array;
195 int have_MD5; /* set if MD5 initialized */
196 struct MD5Context md5c; /* MD5 of include/exclude */
197 char MD5[50]; /* base 64 representation of MD5 */
199 typedef struct s_res_fs FILESET;
202 * FileOptions Resource (options for Includes)
207 char opts[50]; /* Options string */
208 struct s_applyto *applyto; /* applyto strings */
210 typedef struct s_res_fo FILEOPTIONS;
222 typedef struct s_res_sch SCHED;
225 * Group Resource (not used)
231 typedef struct s_res_group GROUP;
236 struct s_res_counter {
239 int32_t MinValue; /* Minimum value */
240 int32_t MaxValue; /* Maximum value */
241 int Global; /* global/local */
242 char *WrapCounter; /* Wrap counter name */
244 typedef struct s_res_counter COUNTER;
253 struct s_res_counter counter; /* Counter resources */
254 char *pool_type; /* Pool type */
255 char *label_format; /* Label format string */
256 int use_catalog; /* maintain catalog for media */
257 int catalog_files; /* maintain file entries in catalog */
258 int use_volume_once; /* write on volume only once */
259 int accept_any_volume; /* accept any volume */
260 uint32_t max_volumes; /* max number of volumes */
261 utime_t VolRetention; /* volume retention period in seconds */
262 utime_t VolUseDuration; /* duration volume can be used */
263 uint32_t MaxVolJobs; /* Maximum jobs on the Volume */
264 uint32_t MaxVolFiles; /* Maximum files on the Volume */
265 uint64_t MaxVolBytes; /* Maximum bytes on the Volume */
266 int AutoPrune; /* default for pool auto prune */
267 int Recycle; /* default for media recycle yes/no */
269 typedef struct s_res_pool POOL;
272 /* Define the Union of all the above
273 * resource structure definitions.
276 struct s_res_dir res_dir;
277 struct s_res_client res_client;
278 struct s_res_store res_store;
279 struct s_res_cat res_cat;
280 struct s_res_job res_job;
281 struct s_res_fs res_fs;
282 struct s_res_sch res_sch;
283 struct s_res_group res_group;
284 struct s_res_pool res_pool;
285 struct s_res_msgs res_msgs;
286 struct s_res_counter res_counter;
287 struct s_res_fo res_fo;
291 typedef union u_res URES;
294 /* Run structure contained in Schedule Resource */
296 struct s_run *next; /* points to next run record */
297 int level; /* level override */
299 POOL *pool; /* Pool override */
300 STORE *storage; /* Storage override */
301 MSGS *msgs; /* Messages override */
304 int minute; /* minute to run job */
305 time_t last_run; /* last time run */
306 time_t next_run; /* next time to run */
307 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
308 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
309 char month[nbytes_for_bits(12)]; /* bit set for each month */
310 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
311 char wpos[nbytes_for_bits(5)]; /* week position */
313 typedef struct s_run RUN;