2 * Director specific configuration and defines
7 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public
20 License along with this program; if not, write to the Free
21 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26 /* NOTE: #includes at the end of this file */
29 * Resource codes -- they must be sequential for indexing
33 #define R_DIRECTOR 1001
36 #define R_STORAGE 1004
37 #define R_CATALOG 1005
38 #define R_SCHEDULE 1006
39 #define R_FILESET 1007
47 * Some resource attributes
50 #define R_ADDRESS 1021
51 #define R_PASSWORD 1022
56 /* Used for certain KeyWord tables */
62 /* Job Level keyword structure */
70 /* Definition of the contents of each Resource */
78 int DIRport; /* where we listen -- UA port server port */
79 char *password; /* Password for UA access */
80 char *query_file; /* SQL query file */
81 char *working_directory; /* WorkingDirectory */
82 char *pid_directory; /* PidDirectory */
83 char *subsys_directory; /* SubsysDirectory */
84 struct s_res_msgs *messages;
85 int MaxConcurrentJobs;
86 btime_t FDConnectTimeout; /* timeout for connect in seconds */
87 btime_t SDConnectTimeout; /* timeout in seconds */
89 typedef struct s_res_dir DIRRES;
98 int FDport; /* Where File daemon listens */
99 int AutoPrune; /* Do automatic pruning? */
100 btime_t FileRetention; /* file retention period in seconds */
101 btime_t JobRetention; /* job retention period in seconds */
104 struct s_res_cat *catalog; /* Catalog resource */
106 typedef struct s_res_client CLIENT;
115 int SDport; /* port where Directors connect */
116 int SDDport; /* data port for File daemon */
122 typedef struct s_res_store STORE;
131 int DBport; /* Port -- not yet implemented */
137 typedef struct s_res_cat CAT;
146 int JobType; /* job type (backup, verify, restore */
147 int level; /* default backup/verify level */
148 int RestoreJobId; /* What -- JobId to restore */
149 char *RestoreWhere; /* Where on disk to restore -- directory */
150 int RestoreOptions; /* How (overwrite, ..) */
151 btime_t MaxRunTime; /* max run time in seconds */
152 btime_t MaxStartDelay; /* max start delay in seconds */
154 struct s_res_msgs *messages; /* How and where to send messages */
155 struct s_res_sch *schedule; /* When -- Automatic schedule */
156 struct s_res_client *client; /* Who to backup */
157 struct s_res_fs *fs; /* What to backup -- Fileset */
158 struct s_res_store *storage; /* Where is device -- Storage daemon */
159 struct s_res_pool *pool; /* Where is media -- Media Pool */
161 typedef struct s_res_job JOB;
170 char **include_array;
173 char **exclude_array;
176 int have_MD5; /* set if MD5 initialized */
177 struct MD5Context md5c; /* MD5 of include/exclude */
179 typedef struct s_res_fs FILESET;
191 typedef struct s_res_sch SCHED;
194 * Group Resource (not used)
200 typedef struct s_res_group GROUP;
210 char *label_format; /* Label format string */
211 int use_catalog; /* maintain catalog for media */
212 int catalog_files; /* maintain file entries in catalog */
213 int use_volume_once; /* write on volume only once */
214 int accept_any_volume; /* accept any volume */
215 int max_volumes; /* max number of volumes */
216 btime_t VolumeRetention; /* volume retention period in seconds */
217 int AutoRecycle; /* default for pool auto recycle */
218 int Recycle; /* default for media recycle yes/no */
220 typedef struct s_res_pool POOL;
223 /* Define the Union of all the above
224 * resource structure definitions.
227 struct s_res_dir res_dir;
228 struct s_res_client res_client;
229 struct s_res_store res_store;
230 struct s_res_cat res_cat;
231 struct s_res_job res_job;
232 struct s_res_fs res_fs;
233 struct s_res_sch res_sch;
234 struct s_res_group res_group;
235 struct s_res_pool res_pool;
236 struct s_res_msgs res_msgs;
240 typedef union u_res URES;
243 /* Run structure contained in Schedule Resource */
245 struct s_run *next; /* points to next run record */
250 int minute; /* minute to run job */
251 time_t last_run; /* last time run */
252 time_t next_run; /* next time to run */
253 char hour[nbytes_for_bits(24)]; /* bit set for each hour */
254 char mday[nbytes_for_bits(31)]; /* bit set for each day of month */
255 char month[nbytes_for_bits(12)]; /* bit set for each month */
256 char wday[nbytes_for_bits(7)]; /* bit set for each day of the week */
258 typedef struct s_run RUN;