- Document setting my.cnf to big file usage.
- Add example of proper index output to doc.
show index from File;
+- Correct the Include syntax in the m4.xxx files in examples/conf
Priority:
For 1.39:
- Remove queue.c code.
-- Correct the Include syntax in the m4.xxx files in examples/conf
-- Get Perl replacement for bregex.c
-- Fix auth compatibility with 1.38
+- Fix ClientRunBefore/AfterJob compatibility.
- Fix re-read of last block to check if job has actually written
a block, and check if block was written by a different job
(i.e. multiple simultaneous jobs writing).
target slot. The catalog should be updated accordingly.
.move transfer device=xxx fromslot=yyy toslot=zzz
+Low priority:
+- Get Perl replacement for bregex.c
- Given all the problems with FIFOs, I think the solution is to do something a
little different, though I will look at the code and see if there is not some
LocationId
NewState???
- Add Comment to Media record
+- Fix auth compatibility with 1.38
+- Update dbcheck to include Log table
+- Update llist to include new fields.
Kern Sibbald
General:
+24Jul06
+- Change cats/sql.c to elimate %-*s format, which I think is turned
+ off in bsnprintf.
+- Add Comment field to llist of a volume.
+- Allow true/false in some yes/no questions.
+- Implement update volume enable=(on|off|true|false|archived|0|1|2)
+- Remove a few /n's when scanning commands from another daemon. This
+ permits adding additional fields later.
+- Modify dbcheck to handle ctl-d and to delete Log table entries.
+- Update README.mingw
22Jul06
- Tweak authentication to work with 1.38.x FDs.
- Tweak catalog make scripts.
send(ctx, "|");
sql_field_seek(mdb, 0);
for (i = 0; i < sql_num_fields(mdb); i++) {
+ char fmtbuf[50];
Dmsg1(800, "list_result looking at field %d\n", i);
field = sql_fetch_field(mdb);
- bsnprintf(buf, sizeof(buf), " %-*s |", (int)field->max_length, field->name);
+ bsnprintf(fmtbuf, sizeof(fmtbuf), "%%-%ds }", (int)field->max_length);
+ bsnprintf(buf, sizeof(buf), fmtbuf, field->name);
send(ctx, buf);
}
send(ctx, "\n");
"VolCapacityBytes,VolStatus,Enabled,Recycle,VolRetention,"
"VolUseDuration,MaxVolJobs,MaxVolFiles,MaxVolBytes,InChanger,"
"EndFile,EndBlock,VolParts,LabelType,StorageId,DeviceId,"
- "LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId"
+ "LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId, "
+ "Comment"
" FROM Media WHERE Media.VolumeName='%s'", mdbr->VolumeName);
} else {
Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,Slot,PoolId,"
"VolCapacityBytes,VolStatus,Enabled,Recycle,VolRetention,"
"VolUseDuration,MaxVolJobs,MaxVolFiles,MaxVolBytes,InChanger,"
"EndFile,EndBlock,VolParts,LabelType,StorageId,DeviceId,"
- "LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId"
+ "LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId, "
+ "Comment"
" FROM Media WHERE Media.PoolId=%s ORDER BY MediaId",
edit_int64(mdbr->PoolId, ed1));
}
switch (RunFields[i].token) {
case 's': /* Data spooling */
token = lex_get_token(lc, T_NAME);
- if (strcasecmp(lc->str, "yes") == 0) {
+ if (strcasecmp(lc->str, "yes") == 0 || strcasecmp(lc->str, "true") == 0) {
lrun.spool_data = true;
lrun.spool_data_set = true;
- } else if (strcasecmp(lc->str, "no") == 0) {
+ } else if (strcasecmp(lc->str, "no") == 0 || strcasecmp(lc->str, "false") == 0) {
lrun.spool_data = false;
lrun.spool_data_set = true;
} else {
break;
case 'W': /* Write part after job */
token = lex_get_token(lc, T_NAME);
- if (strcasecmp(lc->str, "yes") == 0) {
+ if (strcasecmp(lc->str, "yes") == 0 || strcasecmp(lc->str, "true") == 0) {
lrun.write_part_after_job = true;
lrun.write_part_after_job_set = true;
- } else if (strcasecmp(lc->str, "no") == 0) {
+ } else if (strcasecmp(lc->str, "no") == 0 || strcasecmp(lc->str, "false") == 0) {
lrun.write_part_after_job = false;
lrun.write_part_after_job_set = true;
} 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"));
+ return;
+ }
+ if (!db_update_media_record(ua->jcr, ua->db, mr)) {
+ bsendmsg(ua, _("Error updating media record Enabled: ERR=%s"), db_strerror(ua->db));
+ } else {
+ bsendmsg(ua, _("New Enabled is: %d\n"), mr->Enabled);
+ }
+}
+
+
/*
* Update a media record -- allows you to change the
bool done = false;
int i;
const char *kw[] = {
- NT_("VolStatus"), /* 0 */
- NT_("VolRetention"), /* 1 */
- NT_("VolUse"), /* 2 */
- NT_("MaxVolJobs"), /* 3 */
- NT_("MaxVolFiles"), /* 4 */
- NT_("MaxVolBytes"), /* 5 */
- NT_("Recycle"), /* 6 */
- NT_("InChanger"), /* 7 */
- NT_("Slot"), /* 8 */
- NT_("Pool"), /* 9 */
- NT_("FromPool"), /* 10 */
- NT_("AllFromPool"), /* 11 !!! see below !!! */
+ _("VolStatus"), /* 0 */
+ _("VolRetention"), /* 1 */
+ _("VolUse"), /* 2 */
+ _("MaxVolJobs"), /* 3 */
+ _("MaxVolFiles"), /* 4 */
+ _("MaxVolBytes"), /* 5 */
+ _("Recycle"), /* 6 */
+ _("InChanger"), /* 7 */
+ _("Slot"), /* 8 */
+ _("Pool"), /* 9 */
+ _("FromPool"), /* 10 */
+ _("AllFromPool"), /* 11 !!! see below !!! */
+ _("Enabled"), /* 12 */
NULL };
#define AllFromPool 11 /* keep this updated with above */
int j;
POOL_DBR pr;
if ((j=find_arg_with_value(ua, kw[i])) > 0) {
+ /* If all from pool don't select a media record */
if (i != AllFromPool && !select_media_dbr(ua, &mr)) {
return 0;
}
case 11:
update_all_vols_from_pool(ua);
return 1;
+ case 12:
+ update_volenabled(ua, ua->argv[j], &mr);
+ break;
}
done = true;
}
add_prompt(ua, _("Pool")); /* 10 */
add_prompt(ua, _("Volume from Pool")); /* 11 */
add_prompt(ua, _("All Volumes from Pool")); /* 12 */
- add_prompt(ua, _("Done")); /* 13 */
+ add_prompt(ua, _("Enabled")), /* 13 */
+ add_prompt(ua, _("Done")); /* 14 */
i = do_prompt(ua, "", _("Select parameter to modify"), NULL, 0);
- /* For All Volumes from Pool we don't need a Volume record */
- if (i != 12 && i != 13) {
+ /* For All Volumes from Pool and Done, we don't need a Volume record */
+ if (i != 12 && i != 14) {
if (!select_media_dbr(ua, &mr)) { /* Get Volume record */
return 0;
}
case 12:
update_all_vols_from_pool(ua);
return 1;
+
+ case 13:
+ bsendmsg(ua, _("Current Enabled is: %d\n"), mr.Enabled);
+ if (!get_cmd(ua, _("Enter new Enabled: "))) {
+ return 0;
+ }
+ if (strcasecmp(ua->cmd, "yes") == 0 || strcasecmp(ua->cmd, "true") == 0) {
+ mr.Enabled = 1;
+ } else if (strcasecmp(ua->cmd, "no") == 0 || strcasecmp(ua->cmd, "false") == 0) {
+ mr.Enabled = 0;
+ } else if (strcasecmp(ua->cmd, "archived") == 0) {
+ mr.Enabled = 2;
+ } else {
+ mr.Enabled = atoi(ua->cmd);
+ }
+ update_volenabled(ua, ua->cmd, &mr);
+ break;
+
default: /* Done or error */
bsendmsg(ua, _("Selection terminated.\n"));
return 1;
dirname = check_pool_memory_size(dirname, bs->msglen);
if (sscanf(bs->msg, "Hello Director %s calling", dirname) != 1) {
- char addr[64];
- char *who = bnet_get_peer(bs, addr, sizeof(addr)) ? bs->who : addr;
+ char addr[64];
+ char *who = bnet_get_peer(bs, addr, sizeof(addr)) ? bs->who : addr;
bs->msg[100] = 0;
Dmsg2(50, "Bad Hello command from Director at %s: %s\n",
bs->who, bs->msg);
/* Commands received from director that need scanning */
static char jobcmd[] = "JobId=%d Job=%127s SDid=%d SDtime=%d Authorization=%100s";
-static char storaddr[] = "storage address=%s port=%d ssl=%d\n";
+static char storaddr[] = "storage address=%s port=%d ssl=%d";
static char sessioncmd[] = "session %127s %ld %ld %ld %ld %ld %ld\n";
static char restorecmd[] = "restore replace=%c prelinks=%d where=%s\n";
static char restorecmd1[] = "restore replace=%c prelinks=%d where=\n";
-static char verifycmd[] = "verify level=%30s\n";
-static char estimatecmd[] = "estimate listing=%d\n";
-static char runbefore[] = "RunBeforeJob %s\n";
-static char runafter[] = "RunAfterJob %s\n";
-static char runscript[] = "Run OnSuccess=%u OnFailure=%u AbortOnError=%u When=%u Command=%s\n";
+static char verifycmd[] = "verify level=%30s";
+static char estimatecmd[] = "estimate listing=%d";
+static char runbefore[] = "RunBeforeJob %s";
+static char runafter[] = "RunAfterJob %s";
+static char runscript[] = "Run OnSuccess=%u OnFailure=%u AbortOnError=%u When=%u Command=%s";
+
/* Responses sent to Director */
static char errmsg[] = "2999 Invalid command\n";
static char no_auth[] = "2998 No Authorization\n";
static B_DB *db;
static ID_LIST id_list;
static NAME_LIST name_list;
-static char buf[2000];
+static char buf[20000];
+static bool quit = false;
#define MAX_ID_LIST_LEN 10000000
static void repair_bad_paths();
static void repair_bad_filenames();
static void do_interactive_mode();
-static int yes_no(const char *prompt);
+static bool yes_no(const char *prompt);
static void usage()
static void do_interactive_mode()
{
- bool quit = false;
const char *cmd;
printf(_("Hello, this is the database check/correct program.\n"));
}
if (lst->num_ids == lst->max_ids) {
if (lst->max_ids == 0) {
- lst->max_ids = 1000;
+ lst->max_ids = 10000;
lst->Id = (uint32_t *)bmalloc(sizeof(uint32_t) * lst->max_ids);
} else {
lst->max_ids = (lst->max_ids * 3) / 2;
}
if (name->num_ids == name->max_ids) {
if (name->max_ids == 0) {
- name->max_ids = 1000;
+ name->max_ids = 10000;
name->name = (char **)bmalloc(sizeof(char *) * name->max_ids);
} else {
name->max_ids = (name->max_ids * 3) / 2;
if (name_list.num_ids && verbose && yes_no(_("Print the list? (yes/no): "))) {
print_name_list(&name_list);
}
+ if (quit) {
+ return;
+ }
if (fix) {
/* Loop through list of duplicate names */
for (int i=0; i<name_list.num_ids; i++) {
if (name_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
print_name_list(&name_list);
}
+ if (quit) {
+ return;
+ }
if (fix) {
/* Loop through list of duplicate names */
for (int i=0; i<name_list.num_ids; i++) {
}
}
}
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned JobMedia records.\n"), id_list.num_ids);
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned File records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM File WHERE FileId=%u", &id_list);
db_sql_query(db, buf, print_name_handler, NULL);
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Path records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM Path WHERE PathId=%u", &id_list);
db_sql_query(db, buf, print_name_handler, NULL);
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Filename records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM Filename WHERE FilenameId=%u", &id_list);
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned FileSet records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM FileSet WHERE FileSetId=%u", &id_list);
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Client records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM Client WHERE ClientId=%u", &id_list);
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Job records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
+ printf(_("Deleting JobMedia records of orphaned Job records.\n"));
+ delete_id_list("DELETE FROM JobMedia WHERE JobId=%u", &id_list);
+ printf(_("Deleting Log records of orphaned Job records.\n"));
+ delete_id_list("DELETE FROM Log WHERE JobId=%u", &id_list);
}
}
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d Admin Job records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d Restore Job records.\n"), id_list.num_ids);
delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
POOLMEM *name = get_pool_memory(PM_FNAME);
char esc_name[5000];
}
}
}
-
+ if (quit) {
+ return;
+ }
if (fix && id_list.num_ids > 0) {
POOLMEM *name = get_pool_memory(PM_FNAME);
char esc_name[5000];
static char cmd[1000];
printf("%s", prompt);
- if (fgets(cmd, sizeof(cmd), stdin) == NULL)
+ if (fgets(cmd, sizeof(cmd), stdin) == NULL) {
+ printf("\n");
+ quit = true;
return NULL;
- printf("\n");
+ }
strip_trailing_junk(cmd);
return cmd;
}
-static int yes_no(const char *prompt)
+static bool yes_no(const char *prompt)
{
char *cmd;
cmd = get_cmd(prompt);
+ if (!cmd) {
+ quit = true;
+ return false;
+ }
return (strcasecmp(cmd, "yes") == 0) || (strcasecmp(cmd, _("yes")) == 0);
}
The above only needs to be done once unless we change the cross-tools
version. In general, you can run the script multiple times with no
-problem. For it to work, you must have a valid gcc compiler installed on
-your system as well as wget and texinfo. There may be other dependencies.
+problem. For it to work, you must have at a minimum the following:
+
+ gcc
+ g++
+ wget
+ texinfo
+ bison
+ man2html
+
+and possibly other packages.
After building the cross-tools, you can proceed to build the depkgs-win32
packages, which must use the cross-tools compiler.