X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Freporter.c;h=6f0e248678157a65224dff3e8d92f3fdd760acf1;hb=fb2bd066c2f8b34addafe48d62550e3033a59431;hp=17497f897e5c6eed0dd25ab4d09334d9b5cd6cc9;hpb=a6127998ee6dcab6bb034f6ca985b07804a86f9a;p=debian%2Famanda diff --git a/server-src/reporter.c b/server-src/reporter.c index 17497f8..6f0e248 100644 --- a/server-src/reporter.c +++ b/server-src/reporter.c @@ -1002,9 +1002,10 @@ output_stats(void) static void output_tapeinfo(void) { - tape_t *tp, *lasttp; + tape_t *tp; int run_tapes; int skip = 0; + int i, nb_new_tape; if (last_run_tapes > 0) { if(amflush_run) @@ -1068,53 +1069,36 @@ output_tapeinfo(void) else if(run_tapes > 1) g_fprintf(mailf, _("The next %d tapes Amanda expects to use are: "), run_tapes); - - while(run_tapes > 0) { + + nb_new_tape = 0; + for (i=0 ; i < run_tapes ; i++) { if(tp != NULL) { + if (nb_new_tape > 0) { + if (nb_new_tape == 1) + g_fprintf(mailf, _("1 new tape, ")); + else + g_fprintf(mailf, _("%d new tapes, "), nb_new_tape); + nb_new_tape = 0; + } g_fprintf(mailf, "%s", tp->label); + if (i < run_tapes-1) fputs(", ", mailf); } else { - if (run_tapes == 1) - g_fprintf(mailf, _("a new tape")); - else - g_fprintf(mailf, _("%d new tapes"), run_tapes); - run_tapes = 1; + nb_new_tape++; } - - if(run_tapes > 1) fputs(", ", mailf); - - run_tapes -= 1; skip++; + tp = lookup_last_reusable_tape(skip); } + if (nb_new_tape > 0) { + if (nb_new_tape == 1) + g_fprintf(mailf, _("1 new tape")); + else + g_fprintf(mailf, _("%d new tapes"), nb_new_tape); + } fputs(".\n", mailf); - lasttp = lookup_tapepos(lookup_nb_tape()); run_tapes = getconf_int(CNF_RUNTAPES); - if(lasttp && run_tapes > 0 && strcmp(lasttp->datestamp,"0") == 0) { - int c = 0; - while(lasttp && run_tapes > 0 && strcmp(lasttp->datestamp,"0") == 0) { - c++; - lasttp = lasttp->prev; - run_tapes--; - } - lasttp = lookup_tapepos(lookup_nb_tape()); - if(c == 1) { - g_fprintf(mailf, _("The next new tape already labelled is: %s.\n"), - lasttp->label); - } - else { - g_fprintf(mailf, _("The next %d new tapes already labelled are: %s"), c, - lasttp->label); - lasttp = lasttp->prev; - c--; - while(lasttp && c > 0 && strcmp(lasttp->datestamp,"0") == 0) { - g_fprintf(mailf, ", %s", lasttp->label); - lasttp = lasttp->prev; - c--; - } - g_fprintf(mailf, ".\n"); - } - } + print_new_tapes(mailf, run_tapes); } /* ----- */ @@ -2386,7 +2370,12 @@ handle_success( i = level > 0; - if(origkb < 0.0) { + if (origkb < 0.0 && (curprog == P_CHUNKER || curprog == P_TAPER) && + isnormal(repdata->dumper.outsize)) { + /* take origkb from DUMPER line */ + origkb = repdata->dumper.outsize; + } else if (origkb < 0.0) { + /* take origkb from infofile, needed for amflush */ info_t inf; struct tm *tm; int Idatestamp; @@ -2441,6 +2430,8 @@ handle_success( if(!isnormal(repdata->chunker.outsize) && isnormal(repdata->dumper.outsize)) { /* dump to tape */ stats[i].outsize += kbytes; if (abs(kbytes - origkb) >= 32) { + /* server compressed */ + stats[i].corigsize += origkb; stats[i].coutsize += kbytes; } } @@ -2450,10 +2441,13 @@ handle_success( if(curprog == P_DUMPER) { stats[i].dumper_time += sec; if (abs(kbytes - origkb) < 32) { + /* not client compressed */ sp->origsize = kbytes; } else { + /* client compressed */ stats[i].corigsize += sp->origsize; + stats[i].coutsize += kbytes; } dumpdisks[level] +=1; stats[i].dumpdisks +=1; @@ -2464,6 +2458,8 @@ handle_success( sp->outsize = kbytes; stats[i].outsize += kbytes; if (abs(kbytes - origkb) >= 32) { + /* server compressed */ + stats[i].corigsize += origkb; stats[i].coutsize += kbytes; } }