2 * Director specific configuration and defines
9 Copyright (C) 2000-2003 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_CONSOLE 1012
48 #define R_LAST R_CONSOLE
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 */
80 /* Needed for forward references */
93 int DIRport; /* where we listen -- UA port server port */
94 char *DIRaddr; /* bind address */
95 char *password; /* Password for UA access */
96 int enable_ssl; /* Use SSL for UA */
97 char *query_file; /* SQL query file */
98 char *working_directory; /* WorkingDirectory */
99 char *pid_directory; /* PidDirectory */
100 char *subsys_directory; /* SubsysDirectory */
101 int require_ssl; /* Require SSL for all connections */
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 */
113 char *password; /* UA server password */
114 int enable_ssl; /* Use SSL */
125 int db_port; /* Port -- not yet implemented */
126 char *db_address; /* host name for remote access */
127 char *db_socket; /* Socket for local access */
141 int FDport; /* Where File daemon listens */
142 int AutoPrune; /* Do automatic pruning? */
143 utime_t FileRetention; /* file retention period in seconds */
144 utime_t JobRetention; /* job retention period in seconds */
147 CAT *catalog; /* Catalog resource */
148 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
149 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
150 int enable_ssl; /* Use SSL */
160 int SDport; /* port where Directors connect */
161 int SDDport; /* data port for File daemon */
166 int autochanger; /* set if autochanger */
167 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
168 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
169 int enable_ssl; /* Use SSL */
180 int JobType; /* job type (backup, verify, restore */
181 int level; /* default backup/verify level */
182 int Priority; /* Job priority */
183 int RestoreJobId; /* What -- JobId to restore */
184 char *RestoreWhere; /* Where on disk to restore -- directory */
185 char *RestoreBootstrap; /* Bootstrap file */
186 char *RunBeforeJob; /* Run program before Job */
187 char *RunAfterJob; /* Run program after Job */
188 char *RunAfterFailedJob; /* Run program after Job that errs */
189 char *ClientRunBeforeJob; /* Run client program before Job */
190 char *ClientRunAfterJob; /* Run client program after Job */
191 char *WriteBootstrap; /* Where to write bootstrap Job updates */
192 int replace; /* How (overwrite, ..) */
193 utime_t MaxRunTime; /* max run time in seconds */
194 utime_t MaxStartDelay; /* max start delay in seconds */
195 int PrefixLinks; /* prefix soft links with Where path */
196 int PruneJobs; /* Force pruning of Jobs */
197 int PruneFiles; /* Force pruning of Files */
198 int PruneVolumes; /* Force pruning of Volumes */
199 int SpoolAttributes; /* Set to spool attributes in SD */
200 uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */
201 int RescheduleOnError; /* Set to reschedule on error */
202 int RescheduleTimes; /* Number of times to reschedule job */
203 utime_t RescheduleInterval; /* Reschedule interval */
204 utime_t JobRetention; /* job retention period in seconds */
206 MSGS *messages; /* How and where to send messages */
207 SCHED *schedule; /* When -- Automatic schedule */
208 CLIENT *client; /* Who to backup */
209 FILESET *fileset; /* What to backup -- Fileset */
210 STORE *storage; /* Where is device -- Storage daemon */
211 POOL *pool; /* Where is media -- Media Pool */
212 JOB *verify_job; /* Job name to verify */
213 uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
218 /* File options structure */
220 char opts[MAX_FOPTS]; /* options string */
221 alist match; /* match string(s) */
222 alist base_list; /* list of base names */
226 /* This is either an include item or an exclude item */
228 FOPTS *current_opts; /* points to current options structure */
229 FOPTS **opts_list; /* options list */
230 int num_opts; /* number of options items */
231 alist name_list; /* filename list -- holds char * */
241 int new_include; /* Set if new include used */
242 INCEXE **include_items; /* array of incexe structures */
243 int num_includes; /* number in array */
244 INCEXE **exclude_items;
246 int have_MD5; /* set if MD5 initialized */
247 struct MD5Context md5c; /* MD5 of include/exclude */
248 char MD5[30]; /* base 64 representation of MD5 */
263 * Group Resource (not used)
276 int32_t MinValue; /* Minimum value */
277 int32_t MaxValue; /* Maximum value */
278 int32_t CurrentValue; /* Current value */
279 COUNTER *WrapCounter; /* Wrap counter name */
280 CAT *Catalog; /* Where to store */
281 bool created; /* Created in DB */
291 char *pool_type; /* Pool type */
292 char *label_format; /* Label format string */
293 char *cleaning_prefix; /* Cleaning label prefix */
294 int use_catalog; /* maintain catalog for media */
295 int catalog_files; /* maintain file entries in catalog */
296 int use_volume_once; /* write on volume only once */
297 int accept_any_volume; /* accept any volume */
298 int purge_oldest_volume; /* purge oldest volume */
299 int recycle_oldest_volume; /* attempt to recycle oldest volume */
300 int recycle_current_volume; /* attempt recycle of current volume */
301 uint32_t max_volumes; /* max number of volumes */
302 utime_t VolRetention; /* volume retention period in seconds */
303 utime_t VolUseDuration; /* duration volume can be used */
304 uint32_t MaxVolJobs; /* Maximum jobs on the Volume */
305 uint32_t MaxVolFiles; /* Maximum files on the Volume */
306 uint64_t MaxVolBytes; /* Maximum bytes on the Volume */
307 int AutoPrune; /* default for pool auto prune */
308 int Recycle; /* default for media recycle yes/no */
312 /* Define the Union of all the above
313 * resource structure definitions.
333 /* Run structure contained in Schedule Resource */
335 RUN *next; /* points to next run record */
336 int level; /* level override */
337 int Priority; /* priority override */
339 POOL *pool; /* Pool override */
340 STORE *storage; /* Storage override */
341 MSGS *msgs; /* Messages override */
344 int minute; /* minute to run job */
345 time_t last_run; /* last time run */
346 time_t next_run; /* next time to run */
347 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
348 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
349 char month[nbytes_for_bits(12)]; /* bit set for each month */
350 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
351 char wpos[nbytes_for_bits(5)]; /* week position */