- Print warning message if LANG environment variable does not specify
UTF-8.
- New dot commands from Arno.
- .update volume [enabled|disabled|*see below]
- > However, I could easily imagine an option to "update slots" that says
- > "enable=yes|no" that would automatically enable or disable all the Volumes
- > found in the autochanger. This will permit the user to optionally mark all
- > the Volumes in the magazine disabled prior to taking them offsite, and mark
- > them all enabled when bringing them back on site. Coupled with the options
- > to the slots keyword, you can apply the enable/disable to any or all volumes.
.show device=xxx lists information from one storage device, including
devices (I'm not even sure that information exists in the DIR...)
.move eject device=xxx mostly the same as 'unmount xxx' but perhaps with
daemon it was trying to connect to.
- Freespace on DVD requested over and over even with no intervening
writes.
+- .update volume [enabled|disabled|*see below]
+ > However, I could easily imagine an option to "update slots" that says
+ > "enable=yes|no" that would automatically enable or disable all the Volumes
+ > found in the autochanger. This will permit the user to optionally mark all
+ > the Volumes in the magazine disabled prior to taking them offsite, and mark
+ > them all enabled when bringing them back on site. Coupled with the options
+ > to the slots keyword, you can apply the enable/disable to any or all volumes.
bool get_pint(UAContext *ua, const char *prompt);
bool get_yesno(UAContext *ua, const char *prompt);
bool is_yesno(char *val, int *ret);
+int get_enabled(UAContext *ua, const char *val);
void parse_ua_args(UAContext *ua);
/* ua_label.c */
}
}
+/*
+ * Gets an Enabled value => 0, 1, 2, yes, no, archived
+ * Returns: 0, 1, 2 if OK
+ * -1 on error
+ */
+int get_enabled(UAContext *ua, const char *val)
+{
+ int Enabled = -1;
+
+ if (strcasecmp(val, "yes") == 0 || strcasecmp(val, "true") == 0) {
+ Enabled = 1;
+ } else if (strcasecmp(val, "no") == 0 || strcasecmp(val, "false") == 0) {
+ Enabled = 0;
+ } else if (strcasecmp(val, "archived") == 0) {
+ Enabled = 2;
+ } else {
+ Enabled = atoi(val);
+ }
+ if (Enabled < 0 || Enabled > 2) {
+ bsendmsg(ua, _("Invalid Enabled value, it must be yes, no, archived, 0, 1, or 2\n"));
+ return -1;
+ }
+ return Enabled;
+}
+
void parse_ua_args(UAContext *ua)
{
parse_args(ua->cmd, &ua->args, &ua->argc, ua->argk, ua->argv, MAX_CMD_ARGS);
bool scan;
int max_slots;
int drive;
+ int Enabled = 1;
+ bool have_enabled;
+ int i;
if (!open_db(ua)) {
drive = get_storage_drive(ua, store);
scan = find_arg(ua, NT_("scan")) >= 0;
+ if ((i=find_arg_with_value(ua, NT_("Enabled"))) >= 0) {
+ Enabled = get_enabled(ua, ua->argv[i]);
+ if (Enabled < 0) {
+ return;
+ }
+ have_enabled = true;
+ } else {
+ have_enabled = false;
+ }
max_slots = get_num_slots_from_SD(ua);
Dmsg1(100, "max_slots=%d\n", max_slots);
mr.Slot = vl->Slot;
mr.InChanger = 1;
mr.StorageId = store->StorageId;
+ if (have_enabled) {
+ mr.Enabled = Enabled;
+ }
if (!db_update_media_record(ua->jcr, ua->db, &mr)) {
bsendmsg(ua, "%s", db_strerror(ua->db));
} else {
static void update_volenabled(UAContext *ua, char *val, MEDIA_DBR *mr)
{
- if (strcasecmp(val, "yes") == 0 || strcasecmp(val, "true") == 0) {
- mr->Enabled = 1;
- } else if (strcasecmp(val, "no") == 0 || strcasecmp(val, "false") == 0) {
- mr->Enabled = 0;
- } else if (strcasecmp(val, "archived") == 0) {
- mr->Enabled = 2;
- } else {
- mr->Enabled = atoi(val);
- }
- if (mr->Enabled < 0 || mr->Enabled > 2) {
- bsendmsg(ua, _("Invalid Enabled, it must be 0, 1, or 2\n"));
+ mr->Enabled = get_enabled(ua, val);
+ if (mr->Enabled < 0) {
return;
}
if (!db_update_media_record(ua->jcr, ua->db, mr)) {
#undef VERSION
#define VERSION "1.39.21"
-#define BDATE "02 Septermber 2006"
-#define LSMDATE "02Sep06"
+#define BDATE "04 Septermber 2006"
+#define LSMDATE "04Sep06"
#define BYEAR "2006" /* year for copyright messages in progs */
/* Debug flags */
Technical notes on version 1.39
General:
+04Sep06
+kes Implement Enabled on update slots.
02Sep06
kes When doing a label, pass the VolBytes back to the Director,
which puts it in the catalog.