From: Kern Sibbald Date: Fri, 5 Sep 2003 12:37:40 +0000 (+0000) Subject: Add line no. to replace file error msg + fix editing jobids X-Git-Tag: Release-7.0.0~10009 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=45d46d08b9c9a2e454dba08668ec5c104d8e175f;p=bacula%2Fbacula Add line no. to replace file error msg + fix editing jobids git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@687 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index c6fd139f31..afdbafed18 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -28,7 +28,6 @@ Testing to do: (painful) - Figure out how to use ssh or stunnel to protect Bacula communications. For 1.32: -- Specify list of files to restore - Enhance "update slots" to include a "scan" feature scan 1; scan 1-5; scan 1,2,4 ... to update the catalog - Allow a slot or range of slots on the label barcodes command. @@ -39,6 +38,21 @@ For 1.32: volume. - Implement List Volume Job=xxx or List scheduled volumes or Status Director - Make | and < work on FD side. +- Take a careful look a the Basic recycling algorithm. When Bacula + chooses, the order should be: + - Look for Append + - Look for Recycle or Purged + - Prune volumes + - Look for purged + Instead of using lowest media Id, find the least recently used + volume. + + When the tape is mounted and Bacula requests the status + - Do everything possible to use it. + + Define a "available" status, which is the currently mounted + Volume and all volumes that are currently in the autochanger. + For 1.33 - Why can't SQL do the filename sort for restore? @@ -873,3 +887,4 @@ Done: (see kernsdone for more) Look at src/host.h - Use repositioning at the beginning of the tape. - Do full check the command line args in update (e.g. VolStatus ...). +- Specify list of files to restore diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 1d8b980707..3deff19677 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -475,11 +475,13 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx) static void insert_one_file(UAContext *ua, RESTORE_CTX *rx) { + FILE *ffd; + char file[5000]; char *p = ua->cmd; + int line = 0; + switch (*p) { case '<': - FILE *ffd; - char file[5000]; p++; if ((ffd = fopen(p, "r")) == NULL) { bsendmsg(ua, _("Cannot open file %s: ERR=%s\n"), @@ -487,7 +489,10 @@ static void insert_one_file(UAContext *ua, RESTORE_CTX *rx) break; } while (fgets(file, sizeof(file), ffd)) { - insert_file_into_findex_list(ua, rx, file); + line++; + if (!insert_file_into_findex_list(ua, rx, file)) { + bsendmsg(ua, _("Error occurred on line %d of %s\n"), line, p); + } } fclose(ffd); break; @@ -800,7 +805,9 @@ static int jobid_handler(void *ctx, int num_fields, char **row) return 0; /* duplicate id */ } bstrncpy(rx->last_jobid, row[0], sizeof(rx->last_jobid)); - pm_strcat(&rx->JobIds, ","); + if (rx->JobIds[0] != 0) { + pm_strcat(&rx->JobIds, ","); + } pm_strcat(&rx->JobIds, row[0]); return 0; }