DBId_t StorageId;
char Name[MAX_NAME_LENGTH]; /* Device name */
int AutoChanger; /* Set if autochanger */
- int UseProtect; /* Set if the Storage Daemon can handle Protect */
+ int UseProtect; /* Set if the Storage Daemon can handle Protected */
/* Not in database */
bool created; /* set if created by db_create ... */
uint32_t MaxVolJobs; /* Max Jobs on Volume */
uint32_t MaxVolFiles; /* Max files on Volume */
int32_t Recycle; /* recycle yes/no */
- int32_t Protect; /* Protect yes/no */
- int32_t UseProtect; /* Use Protect feature yes/no */
+ int32_t Protected; /* Protected yes/no */
+ int32_t UseProtect; /* Use Protected feature yes/no */
int32_t Slot; /* slot in changer */
int32_t Enabled; /* 0=disabled, 1=enabled, 2=archived */
int32_t InChanger; /* Volume currently in changer */
ScratchPoolId INTEGER UNSIGNED DEFAULT 0,
RecyclePoolId INTEGER UNSIGNED DEFAULT 0,
Comment BLOB,
- Protect TINYINT DEFAULT 0,
+ Protected TINYINT DEFAULT 0,
UseProtect TINYINT DEFAULT 0,
PRIMARY KEY(MediaId),
UNIQUE (VolumeName(128)),
scratchpoolid integer default 0,
recyclepoolid integer default 0,
comment text,
- protect smallint default 0,
+ protected smallint default 0,
useprotect smallint default 0,
primary key (mediaid)
);
ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
Comment TEXT,
- Protect TINYINT DEFAULT 0,
+ Protected TINYINT DEFAULT 0,
UseProtect TINYINT DEFAULT 0,
PRIMARY KEY(MediaId)
);
"VolStatus,Slot,VolBytes,InChanger,VolReadTime,VolWriteTime,VolType,"
"VolParts,VolCloudParts,LastPartBytes,"
"EndFile,EndBlock,LabelType,StorageId,DeviceId,LocationId,"
-"ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,CacheRetention,UseProtect,Protect)"
+"ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,CacheRetention,UseProtect,Protected)"
"VALUES ('%s','%s',0,%lu,%s,%s,%ld,%s,%s,%lu,%lu,'%s',%ld,%s,%ld,%s,%s,%ld,"
- "%ld,%ld,'%s',%ld,%ld,%ld,%s,%s,%s,%s,%s,%ld,%ld,%s,%ld)",
+ "%ld,%ld,'%s',%ld,%ld,%ld,%s,%s,%s,%s,%s,%ld,%ld,%s,%ld,%ld)",
esc_name,
esc_mtype, mr->PoolId,
edit_uint64(mr->MaxVolBytes,ed1),
mr->ActionOnPurge,
edit_uint64(mr->CacheRetention, ed14),
mr->UseProtect,
- mr->Protect
+ mr->Protected
);
"EndFile,EndBlock,VolType,VolParts,VolCloudParts,LastPartBytes,"
"LabelType,LabelDate,StorageId,"
"Enabled,LocationId,RecycleCount,InitialWrite,"
- "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protect,UseProtect "
+ "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protected,UseProtect "
"FROM Media JOIN Pool USING (PoolId) WHERE MediaId=%s",
edit_int64(mr->MediaId, ed1));
} else { /* find by name */
"EndFile,EndBlock,VolType,VolParts,VolCloudParts,LastPartBytes,"
"LabelType,LabelDate,StorageId,"
"Enabled,LocationId,RecycleCount,InitialWrite,"
- "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protect,UseProtect "
+ "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protected,UseProtect "
"FROM Media JOIN Pool USING (PoolId) WHERE VolumeName='%s'", esc);
}
mr->ActionOnPurge = str_to_int32(row[43]);
mr->CacheRetention = str_to_int64(row[44]);
bstrncpy(mr->Pool, row[45], sizeof(mr->Pool));
- mr->Protect = str_to_int64(row[46]);
- mr->UseProtect = str_to_int64(row[47]);
+ mr->Protected = str_to_int64(row[45]);
+ mr->UseProtect = str_to_int64(row[46]);
+
ok = true;
}
} else {
"EndFile,EndBlock,VolType,Media.LabelType,StorageId,DeviceId,"
"MediaAddressing,VolReadTime,VolWriteTime,"
"LocationId,RecycleCount,InitialWrite,Media.ScratchPoolId,Media.RecyclePoolId, "
- "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protect, UseProtect"
+ "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protected, UseProtect"
" FROM Media %s WHERE Media.VolumeName='%s' %s",
expiresin,
join,
"EndFile,EndBlock,VolType,Media.LabelType,StorageId,DeviceId,"
"MediaAddressing,VolReadTime,VolWriteTime,"
"LocationId,RecycleCount,InitialWrite,Media.ScratchPoolId,Media.RecyclePoolId, "
- "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protect, UseProtect"
+ "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protected, UseProtect"
" FROM Media %s WHERE Media.PoolId=%s %s ORDER BY MediaId",
expiresin,
join,
"LabelType=%d,StorageId=%s,PoolId=%s,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%d,MaxVolFiles=%d,Enabled=%d,LocationId=%s,"
"ScratchPoolId=%s,RecyclePoolId=%s,RecycleCount=%d,Recycle=%d,"
- "ActionOnPurge=%d,CacheRetention=%s,EndBlock=%u,Protect=%d,UseProtect=%d"
+ "ActionOnPurge=%d,CacheRetention=%s,EndBlock=%u,Protected=%d,UseProtect=%d"
" WHERE VolumeName='%s'",
mr->VolJobs, mr->VolFiles, mr->VolBlocks,
edit_uint64(mr->VolBytes, ed1),
edit_uint64(mr->RecyclePoolId, ed15),
mr->RecycleCount,mr->Recycle, mr->ActionOnPurge,
edit_uint64(mr->CacheRetention, ed16),
- mr->EndBlock,mr->Protect,mr->UseProtect,
+ mr->EndBlock,mr->Protected,mr->UseProtect,
esc_name);
Dmsg1(dbglevel1, "%s\n", cmd);
CREATE INDEX meta_attachmentemailid ON MetaAttachment (AttachmentEmailId(255));
ALTER TABLE Media
- MODIFY COLUMN Protect TINYINT DEFAULT 0,
+ MODIFY COLUMN Protected TINYINT DEFAULT 0,
MODIFY COLUMN UseProtect TINYINT DEFAULT 0;
ALTER TABLE Object
ADD COLUMN WriteDevice blob,
ADD COLUMN Encrypted int default 0;
-ALTER TABLE Media
- ADD COLUMN Protect smallint default 0,
- ADD COLUMN UseProtect smallint default 0;
-
INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1026');
UPDATE Version SET VersionId=1026;
ALTER TABLE Job ADD COLUMN StatusInfo text default '';
ATLER TABLE Job ADD COLUMN Encrypted int default 0;
-ALTER TABLE Media ADD COLUMN Protect smallint default 0;
+ALTER TABLE Media ADD COLUMN Protected smallint default 0;
ALTER TABLE Media ADD COLUMN IsProtect smallint default 0;
INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
" VolErrors=%u VolWrites=%lld MaxVolBytes=%lld EndTime=%lld VolStatus=%10s"
" Slot=%d relabel=%d InChanger=%d VolReadTime=%llu VolWriteTime=%llu"
" VolFirstWritten=%lld VolType=%u VolParts=%d VolCloudParts=%d"
- " LastPartBytes=%lld Enabled=%d Recycle=%d Protect=%d UseProtect=%d\n";
+ " LastPartBytes=%lld Enabled=%d Recycle=%d Protected=%d UseProtect=%d\n";
static char FileEvent_add[] = "%c %d %127s %127s 0";
/* Full format when coming from the Verify Job */
" MaxVolJobs=%u MaxVolFiles=%u InChanger=%d VolReadTime=%s"
" VolWriteTime=%s EndFile=%u EndBlock=%u VolType=%u LabelType=%d"
" MediaId=%s ScratchPoolId=%s VolParts=%d VolCloudParts=%d"
- " LastPartBytes=%lld Enabled=%d MaxPoolBytes=%s PoolBytes=%s Recycle=%d Protect=%d UseProtect=%d\n";
+ " LastPartBytes=%lld Enabled=%d MaxPoolBytes=%s PoolBytes=%s Recycle=%d Protected=%d UseProtect=%d\n";
static char OK_create[] = "1000 OK CreateJobMedia\n";
mr->Enabled,
edit_uint64(pr.MaxPoolBytes, ed11),
edit_uint64(pr.PoolBytes, ed12),
- mr->Recycle, mr->Protect, mr->UseProtect);
+ mr->Recycle, mr->Protected, mr->UseProtect);
unbash_spaces(mr->VolumeName);
Dmsg2(100, "Vol Info for %s: %s", jcr->Job, sd->msg);
return stat;
utime_t VolLastWritten;
int n;
int can_create=0, use_protect=0;
- int Enabled, Recycle, Protect, UseProtect;
+ int Enabled, Recycle, Protected, UseProtect;
JobId_t JobId = 0;
STORE *wstore = jcr->store_mngr->get_wstore();
&VolLastWritten, &sdmr.VolStatus, &sdmr.Slot, &label, &sdmr.InChanger,
&sdmr.VolReadTime, &sdmr.VolWriteTime, &VolFirstWritten,
&sdmr.VolType, &sdmr.VolParts, &sdmr.VolCloudParts,
- &sdmr.LastPartBytes, &Enabled, &Recycle, &Protect, &UseProtect);
+ &sdmr.LastPartBytes, &Enabled, &Recycle, &Protected, &UseProtect);
if (n == 29) {
db_lock(jcr->db);
Dmsg3(400, "Update media %s oldStat=%s newStat=%s\n", sdmr.VolumeName,
mr.LastPartBytes = sdmr.LastPartBytes;
mr.Enabled = Enabled; /* byte assignment */
mr.Recycle = Recycle; /* byte assignment */
- mr.Protect = Protect; /* byte assignment */
+ mr.Protected = Protected; /* byte assignment */
mr.UseProtect = UseProtect; /* byte assignment */
bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus));
mr.VolReadTime = sdmr.VolReadTime;
}
Dmsg2(dbglvl, "VolJobs=%d FirstWritten=%d\n", mr->VolJobs, mr->FirstWritten);
if (ok) {
- /* If the current device uses the Protect feature, we need to keep track of it */
+ /* If the current device uses the Protected feature, we need to keep track of it */
if (use_protect == 1) {
mr->UseProtect = 1;
}
expired = true;
}
}
- /* Here, if the volume is Protect, we cannot change the status if a storage
+ /* Here, if the volume is Protected, we cannot change the status if a storage
* is not connected
*/
if (expired) {
}
Dmsg2(dbglvl, "Vol=%s expired=%d\n", mr->VolumeName, expired);
/* Special case, we have marked the volume as Expired, and the Storage
- * Daemon wants to mark it as Protect
+ * Daemon wants to mark it as Protected
*/
if (expired && mr->UseProtect) {
return false;
ua->send_events("DC0014", EVENTS_TYPE_COMMAND,
"%s storage=%s volume=%s", action, storage, mr.VolumeName);
- /* Protect us from spaces */
+ /* Protected us from spaces */
bash_spaces(mr.VolumeName);
bash_spaces(mr.MediaType);
bash_spaces(pr.Name);
goto bail_out;
}
- /* Protect us from spaces */
+ /* Protected us from spaces */
bash_spaces(mr.MediaType);
bash_spaces(storage);
bash_spaces(mr.VolumeName);
* is disabled for the specific device, this will be a no-op.
*/
- /* Protect us from spaces */
+ /* Protected us from spaces */
bash_spaces(mr->VolumeName);
bash_spaces(mr->MediaType);
bash_spaces(pool);
}
/*
- * Protect a volume. If the command is executed from RunScript Admin
+ * Protected a volume. If the command is executed from RunScript Admin
* the return code of the commnand is used to update the status.
*/
static int update_volumeprotect_cmd(UAContext *ua)
Mmsg(tmp, "SELECT Media.MediaId, Media.MediaType, Media.VolumeName, Storage.Name "
"FROM Media JOIN Storage USING (StorageId) JOIN Pool USING (PoolId) "
- "WHERE UseProtect=1 AND Protect=0 AND VolStatus IN ('Used', 'Full') %s "
+ "WHERE UseProtect=1 AND Protected=0 AND VolStatus IN ('Used', 'Full') %s "
"ORDER BY Storage.Name", filter.c_str());
db_sql_query(ua->db, tmp.c_str(),
ua->send_events("DC0013", EVENTS_TYPE_COMMAND, "volumeprotect storage=%s dev=%s volume=%s",
elt->storage, selected_dev_name, elt->volname);
ua->send_msg("%s", sd->msg);
- Mmsg(tmp, "UPDATE Media SET Protect=1 WHERE MediaId=%d", elt->id);
+ Mmsg(tmp, "UPDATE Media SET Protected=1 WHERE MediaId=%d", elt->id);
db_lock(ua->db);
if (!db_sql_query(ua->db, tmp.c_str(), NULL, NULL)) {
ua->error_msg("Unable to update volume record. %s\n", ua->db->errmsg);
" VolErrors=%u VolWrites=%u MaxVolBytes=%s EndTime=%s VolStatus=%s"
" Slot=%d relabel=%d InChanger=%d VolReadTime=%s VolWriteTime=%s"
" VolFirstWritten=%s VolType=%u VolParts=%d VolCloudParts=%d"
- " LastPartBytes=%lld Enabled=%d Recycle=%d Protect=%d UseProtect=%d\n";
+ " LastPartBytes=%lld Enabled=%d Recycle=%d Protected=%d UseProtect=%d\n";
static char Create_jobmedia[] = "CatReq JobId=%ld CreateJobMedia\n";
static char FileAttributes[] = "UpdCat JobId=%ld FileAttributes ";
" VolReadTime=%lld VolWriteTime=%lld EndFile=%lu EndBlock=%lu"
" VolType=%lu LabelType=%ld MediaId=%lld ScratchPoolId=%lld"
" VolParts=%d VolCloudParts=%d LastPartBytes=%lld Enabled=%d MaxPoolBytes=%lld PoolBytes=%lld Recycle=%d"
- " Protect=%d UseProtect=%d\n";
+ " Protected=%d UseProtect=%d\n";
static char OK_create[] = "1000 OK CreateJobMedia\n";
BSOCK *dir = jcr->dir_bsock;
VOLUME_CAT_INFO vol;
int n;
- int32_t Enabled, Recycle, Protect, UseProtect;
+ int32_t Enabled, Recycle, Protected, UseProtect;
int32_t InChanger;
dcr->setVolCatInfo(false);
&vol.EndFile, &vol.EndBlock, &vol.VolCatType,
&vol.LabelType, &vol.VolMediaId, &vol.VolScratchPoolId,
&vol.VolCatParts, &vol.VolCatCloudParts,
- &vol.VolLastPartBytes, &Enabled, &vol.MaxPoolBytes, &vol.PoolBytes, &Recycle, &Protect, &UseProtect);
+ &vol.VolLastPartBytes, &Enabled, &vol.MaxPoolBytes, &vol.PoolBytes, &Recycle, &Protected, &UseProtect);
Dmsg2(dbglvl, "<dird n=%d %s", n, dir->msg);
if (n != 35) {
Dmsg1(dbglvl, "get_volume_info failed: ERR=%s", dir->msg);
vol.InChanger = InChanger; /* bool in structure */
vol.VolEnabled = Enabled; /* bool in structure */
vol.VolRecycle = Recycle; /* bool in structure */
- vol.Protect = Protect; /* bool in structure */
+ vol.Protected = Protected; /* bool in structure */
vol.UseProtect = UseProtect; /* bool in structure */
vol.is_valid = true;
vol.VolCatBytes = vol.VolCatAmetaBytes + vol.VolCatAdataBytes;
if (dev->is_worm() && vol.VolRecycle) {
Jmsg(jcr, M_INFO, 0, _("WORM cassette detected: setting Recycle=No on Volume=\"%s\"\n"), vol.VolCatName);
vol.VolRecycle = false;
- vol.Protect = true;
+ vol.Protected = true;
}
pm_strcpy(VolumeName, vol.VolCatName);
bash_spaces(VolumeName);
vol.VolLastPartBytes,
Enabled,
Recycle,
- vol.Protect,
+ vol.Protected,
dev->use_protect()
);
Dmsg1(100, ">dird %s", dir->msg);
}
events_send_msg(dcr->jcr, "SJ0003", EVENTS_TYPE_VOLUME, me->hdr.name, (intptr_t)dcr->jcr,
"Mark Volume \"%s\" as immutable", dev->getVolCatName());;
- dev->VolCatInfo.Protect = 1;
+ dev->VolCatInfo.Protected = 1;
}
}
Jmsg(dcr->jcr, M_INFO, 0, _("Marking Volume \"%s\" as read-only\n"),
dev->getVolCatName());
}
- dev->VolCatInfo.Protect = 1;
+ dev->VolCatInfo.Protected = 1;
events_send_msg(dcr->jcr, "SJ0003", EVENTS_TYPE_VOLUME, me->hdr.name, (intptr_t)dcr->jcr,
"Mark Volume \"%s\" as read-only", dev->getVolCatName());;
}
utime_t VolFirstWritten; /* Time of first write */
utime_t VolLastWritten; /* Time of last write */
bool InChanger; /* Set if vol in current magazine */
- bool Protect; /* Set if the vol is Readonly, worm or immutable */
+ bool Protected; /* Set if the vol is Readonly, worm or immutable */
bool UseProtect; /* Set if the device can set the volume Readonly, worm or immutable */
bool is_valid; /* set if this data is valid */
bool VolEnabled; /* set if volume enabled */
CREATE INDEX meta_attachmentemailid ON MetaAttachment (AttachmentEmailId(255));
ALTER TABLE Media
- MODIFY COLUMN Protect TINYINT DEFAULT 0,
+ MODIFY COLUMN Protected TINYINT DEFAULT 0,
MODIFY COLUMN UseProtect TINYINT DEFAULT 0;
ALTER TABLE Object
ADD COLUMN WriteDevice blob,
ADD COLUMN Encrypted int default 0;
-ALTER TABLE Media
- ADD COLUMN Protect smallint default 0,
- ADD COLUMN UseProtect smallint default 0;
-
INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1026');
UPDATE Version SET VersionId=1026;
ALTER TABLE Job ADD COLUMN StatusInfo text default '';
ATLER TABLE Job ADD COLUMN Encrypted int default 0;
-ALTER TABLE Media ADD COLUMN Protect smallint default 0;
-ALTER TABLE Media ADD COLUMN IsProtect smallint default 0;
+ALTER TABLE Media ADD COLUMN Protected smallint default 0;
+ALTER TABLE Media ADD COLUMN UseProtect smallint default 0;
INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1026');