1 Index: src/dird/msgchan.c
2 ===================================================================
3 --- src/dird/msgchan.c (revision 5107)
4 +++ src/dird/msgchan.c (working copy)
6 /* Commands sent to Storage daemon */
7 static char jobcmd[] = "JobId=%s job=%s job_name=%s client_name=%s "
8 "type=%d level=%d FileSet=%s NoAttr=%d SpoolAttr=%d FileSetMD5=%s "
9 - "SpoolData=%d WritePartAfterJob=%d PreferMountedVols=%d\n";
10 + "SpoolData=%d SpoolSize=%s WritePartAfterJob=%d PreferMountedVols=%d\n";
11 static char use_storage[] = "use storage=%s media_type=%s pool_name=%s "
12 "pool_type=%s append=%d copy=%d stripe=%d\n";
13 static char use_device[] = "use device=%s\n";
15 POOL_MEM job_name, client_name, fileset_name;
19 + char ed1[30], ed2[30];
21 sd = jcr->store_bsock;
24 job_name.c_str(), client_name.c_str(),
25 jcr->JobType, jcr->JobLevel,
26 fileset_name.c_str(), !jcr->pool->catalog_files,
27 - jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data,
28 - jcr->write_part_after_job, jcr->job->PreferMountedVolumes);
29 + jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data,
30 + edit_int64(jcr->spool_size, ed2), jcr->write_part_after_job,
31 + jcr->job->PreferMountedVolumes);
32 Dmsg1(100, ">stored: %s\n", sd->msg);
33 if (bget_dirmsg(sd) > 0) {
34 Dmsg1(100, "<stored: %s", sd->msg);
36 ===================================================================
37 --- src/dird/job.c (revision 5107)
38 +++ src/dird/job.c (working copy)
40 jcr->fileset = job->fileset;
41 jcr->messages = job->messages;
42 jcr->spool_data = job->spool_data;
43 + jcr->spool_size = job->spool_size;
44 jcr->write_part_after_job = job->write_part_after_job;
45 if (jcr->RestoreBootstrap) {
46 free(jcr->RestoreBootstrap);
47 Index: src/dird/dird_conf.c
48 ===================================================================
49 --- src/dird/dird_conf.c (revision 5107)
50 +++ src/dird/dird_conf.c (working copy)
52 {"enabled", store_bool, ITEM(res_job.enabled), 0, ITEM_DEFAULT, true},
53 {"spoolattributes",store_bool, ITEM(res_job.SpoolAttributes), 0, ITEM_DEFAULT, false},
54 {"spooldata", store_bool, ITEM(res_job.spool_data), 0, ITEM_DEFAULT, false},
55 + {"spoolsize", store_size, ITEM(res_job.spool_size), 0, 0, 0},
56 {"rerunfailedlevels", store_bool, ITEM(res_job.rerun_failed_levels), 0, ITEM_DEFAULT, false},
57 {"prefermountedvolumes", store_bool, ITEM(res_job.PreferMountedVolumes), 0, ITEM_DEFAULT, true},
58 {"runbeforejob", store_short_runscript, ITEM(res_job.RunScripts), 0, 0, 0},
59 Index: src/dird/dird_conf.h
60 ===================================================================
61 --- src/dird/dird_conf.h (revision 5107)
62 +++ src/dird/dird_conf.h (working copy)
64 utime_t RescheduleInterval; /* Reschedule interval */
65 utime_t JobRetention; /* job retention period in seconds */
66 uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
67 + int64_t spool_size; /* Size of spool file for this job */
68 int RescheduleTimes; /* Number of times to reschedule job */
69 bool RescheduleOnError; /* Set to reschedule on error */
70 bool PrefixLinks; /* prefix soft links with Where path */
71 Index: src/stored/job.c
72 ===================================================================
73 --- src/stored/job.c (revision 5107)
74 +++ src/stored/job.c (working copy)
76 /* Requests from the Director daemon */
77 static char jobcmd[] = "JobId=%d job=%127s job_name=%127s client_name=%127s "
78 "type=%d level=%d FileSet=%127s NoAttr=%d SpoolAttr=%d FileSetMD5=%127s "
79 - "SpoolData=%d WritePartAfterJob=%d PreferMountedVols=%d\n";
80 + "SpoolData=%d SpoolSize=%s WritePartAfterJob=%d PreferMountedVols=%d\n";
83 /* Responses sent to Director daemon */
88 + char spool_size[30];
89 BSOCK *dir = jcr->dir_bsock;
90 POOL_MEM job_name, client_name, job, fileset_name, fileset_md5;
91 int JobType, level, spool_attributes, no_attributes, spool_data;
93 stat = sscanf(dir->msg, jobcmd, &JobId, job.c_str(), job_name.c_str(),
95 &JobType, &level, fileset_name.c_str(), &no_attributes,
96 - &spool_attributes, fileset_md5.c_str(), &spool_data,
97 + &spool_attributes, fileset_md5.c_str(), &spool_data, spool_size,
98 &write_part_after_job, &PreferMountedVols);
101 pm_strcpy(jcr->errmsg, dir->msg);
102 bnet_fsend(dir, BAD_job, stat, jcr->errmsg);
103 Dmsg1(100, ">dird: %s", dir->msg);
105 jcr->no_attributes = no_attributes;
106 jcr->spool_attributes = spool_attributes;
107 jcr->spool_data = spool_data;
108 + jcr->spool_size = str_to_int64(spool_size);
109 jcr->write_part_after_job = write_part_after_job;
110 jcr->fileset_md5 = get_pool_memory(PM_NAME);
111 pm_strcpy(jcr->fileset_md5, fileset_md5);
112 Index: src/stored/acquire.c
113 ===================================================================
114 --- src/stored/acquire.c (revision 5107)
115 +++ src/stored/acquire.c (working copy)
117 if (dcr->attached_to_dev) {
118 detach_dcr_from_dev(dcr);
120 - dcr->max_job_spool_size = dev->device->max_job_spool_size;
121 + /* Use job spoolsize prior to device spoolsize*/
122 + if (jcr->spool_size) {
123 + dcr->max_job_spool_size = jcr->spool_size;
125 + dcr->max_job_spool_size = dev->device->max_job_spool_size;
127 dcr->device = dev->device;
129 attach_dcr_to_dev(dcr);
131 ===================================================================
132 --- src/jcr.h (revision 5107)
133 +++ src/jcr.h (working copy)
135 int replace; /* Replace option */
136 int NumVols; /* Number of Volume used in pool */
137 int reschedule_count; /* Number of times rescheduled */
138 + int64_t spool_size; /* Spool size for this job */
139 bool spool_data; /* Spool data in SD */
140 bool acquired_resource_locks; /* set if resource locks acquired */
141 bool term_wait_inited; /* Set when cond var inited */
143 bool spool_attributes; /* set if spooling attributes */
144 bool no_attributes; /* set if no attributes wanted */
145 bool spool_data; /* set to spool data */
146 + int64_t spool_size; /* Spool size for this job */
147 int CurVol; /* Current Volume count */
148 DIRRES* director; /* Director resource */
149 alist *write_store; /* list of write storage devices sent by DIR */