{"mediatype", store_strname, ITEM(res_store.media_type), 0, ITEM_REQUIRED, 0},
{"autochanger", store_bool, ITEM(res_store.autochanger), 0, ITEM_DEFAULT, 0},
{"enabled", store_bool, ITEM(res_store.enabled), 0, ITEM_DEFAULT, true},
+ {"allowcompression", store_bool, ITEM(res_store.AllowCompress), 0, ITEM_DEFAULT, true},
{"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0},
{"maximumconcurrentjobs", store_pint32, ITEM(res_store.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
{"sddport", store_pint32, ITEM(res_store.SDDport), 0, 0, 0}, /* deprecated */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
bool tls_require; /* Require TLS */
bool enabled; /* Set if device is enabled */
bool autochanger; /* set if autochanger */
+ bool AllowCompress; /* set if this Storage should allow jobs to enable compression */
int64_t StorageId; /* Set from Storage DB record */
utime_t heartbeat_interval; /* Interval to send heartbeats */
uint32_t drives; /* number of drives in autochanger */
{
FILESET *fileset = jcr->fileset;
BSOCK *fd = jcr->file_bsock;
+ STORE *store = jcr->wstore;
int num;
bool include = true;
}
for (j=0; j<ie->num_opts; j++) {
FOPTS *fo = ie->opts_list[j];
- fd->fsend("O %s\n", fo->opts);
bool enhanced_wild = false;
for (k=0; fo->opts[k]!='\0'; k++) {
}
}
+ /* Strip out compression option Zn if disallowed for this Storage */
+ if (!store->AllowCompress) {
+ char newopts[MAX_FOPTS];
+ int j = 0;
+ for (k=0; fo->opts[k]!='\0'; k++) {
+ /* Z compress option is followed by the single-digit compress level */
+ if (fo->opts[k]=='Z') {
+ k++; /* skip option and level */
+ } else {
+ newopts[j] = fo->opts[k];
+ j++;
+ }
+ }
+ newopts[j] = '\0';
+
+ Jmsg(jcr, M_INFO, 0,
+ _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") );
+
+ /* Send the new trimmed option set without overwriting fo->opts */
+ fd->fsend("O %s\n", newopts);
+ } else {
+ /* Send the original options */
+ fd->fsend("O %s\n", fo->opts);
+ }
+
for (k=0; k<fo->regex.size(); k++) {
fd->fsend("R %s\n", fo->regex.get(k));
}