+inline void USTORE::set_source(const char *where)
+{
+ if (!store_source) {
+ store_source = get_pool_memory(PM_MESSAGE);
+ }
+ pm_strcpy(store_source, where);
+}
+
+
+/*
+ * Job Resource
+ */
+class JOB {
+public:
+ RES hdr;
+
+ int JobType; /* job type (backup, verify, restore */
+ int JobLevel; /* default backup/verify level */
+ int Priority; /* Job priority */
+ int RestoreJobId; /* What -- JobId to restore */
+ char *RestoreWhere; /* Where on disk to restore -- directory */
+ char *RestoreBootstrap; /* Bootstrap file */
+ alist *RunScripts; /* Run {client} program {after|before} Job */
+ union {
+ char *WriteBootstrap; /* Where to write bootstrap Job updates */
+ char *WriteVerifyList; /* List of changed files */
+ };
+ int replace; /* How (overwrite, ..) */
+ utime_t MaxRunTime; /* max run time in seconds */
+ utime_t MaxWaitTime; /* max blocking time in seconds */
+ utime_t FullMaxWaitTime; /* Max Full job wait time */
+ utime_t DiffMaxWaitTime; /* Max Differential job wait time */
+ utime_t IncMaxWaitTime; /* Max Incremental job wait time */
+ utime_t MaxStartDelay; /* max start delay in seconds */
+ utime_t RescheduleInterval; /* Reschedule interval */
+ utime_t JobRetention; /* job retention period in seconds */
+ uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
+ int RescheduleTimes; /* Number of times to reschedule job */
+ bool RescheduleOnError; /* Set to reschedule on error */
+ bool PrefixLinks; /* prefix soft links with Where path */
+ bool PruneJobs; /* Force pruning of Jobs */
+ bool PruneFiles; /* Force pruning of Files */
+ bool PruneVolumes; /* Force pruning of Volumes */
+ bool SpoolAttributes; /* Set to spool attributes in SD */
+ bool spool_data; /* Set to spool data in SD */
+ bool rerun_failed_levels; /* Upgrade to rerun failed levels */
+ bool PreferMountedVolumes; /* Prefer vols mounted rather than new one */
+ bool write_part_after_job; /* Set to write part after job in SD */
+ bool enabled; /* Set if job enabled */
+
+ MSGS *messages; /* How and where to send messages */
+ SCHED *schedule; /* When -- Automatic schedule */
+ CLIENT *client; /* Who to backup */
+ FILESET *fileset; /* What to backup -- Fileset */
+ alist *storage; /* Where is device -- list of Storage to be used */
+ POOL *pool; /* Where is media -- Media Pool */
+ POOL *full_pool; /* Pool for Full backups */
+ POOL *inc_pool; /* Pool for Incremental backups */
+ POOL *diff_pool; /* Pool for Differental backups */
+ char *selection_pattern;
+ int selection_type;
+ union {
+ JOB *verify_job; /* Job name to verify */
+ };
+ JOB *jobdefs; /* Job defaults */
+ alist *run_cmds; /* Run commands */
+ uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
+
+ /* Methods */
+ char *name() const;
+};
+
+inline char *JOB::name() const { return hdr.name; }
+
+#undef MAX_FOPTS
+#define MAX_FOPTS 34
+
+/* File options structure */
+struct FOPTS {
+ char opts[MAX_FOPTS]; /* options string */
+ alist regex; /* regex string(s) */
+ alist regexdir; /* regex string(s) for directories */
+ alist regexfile; /* regex string(s) for files */
+ alist wild; /* wild card strings */
+ alist wilddir; /* wild card strings for directories */
+ alist wildfile; /* wild card strings for files */
+ alist wildbase; /* wild card strings for files without '/' */
+ alist base; /* list of base names */
+ alist fstype; /* file system type limitation */
+ alist drivetype; /* drive type limitation */
+ char *reader; /* reader program */
+ char *writer; /* writer program */
+};
+
+
+/* This is either an include item or an exclude item */
+struct INCEXE {
+ FOPTS *current_opts; /* points to current options structure */
+ FOPTS **opts_list; /* options list */
+ int num_opts; /* number of options items */
+ alist name_list; /* filename list -- holds char * */