diff --git a/Makefile.am b/Makefile.am index 4c7c9151..baa044c8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -496,7 +496,6 @@ endif $(TESTENV) ./mktest$(EXEEXT) append 4 500 test/disk3/_b/_a/* $(TESTENV) ./mktest$(EXEEXT) truncate 4 500 test/disk2/_b/_b/* $(TESTENV) ./mktest$(EXEEXT) truncate 4 500 test/disk3/_b/_b/* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) -a check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) -a check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log diff --git a/check.c b/check.c index d5a31711..a1e53efb 100644 --- a/check.c +++ b/check.c @@ -1002,7 +1002,9 @@ static int state_check_process(struct snapraid_state* state, int check, int fix, } fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub); - printf("unrecoverable %s\n", path); + if (state->opt.verbose) { + printf("unrecoverable %s\n", path); + } /* and do not set the time if damaged */ continue; @@ -1015,7 +1017,9 @@ static int state_check_process(struct snapraid_state* state, int check, int fix, } fprintf(stdlog, "status:recovered:%s:%s\n", handle[j].disk->name, file->sub); - printf("recovered %s\n", path); + if (state->opt.verbose) { + printf("recovered %s\n", path); + } inode = handle[j].st.st_ino; @@ -1055,14 +1059,20 @@ static int state_check_process(struct snapraid_state* state, int check, int fix, if (file_flag_has(file, FILE_IS_DAMAGED)) { if (!check) { fprintf(stdlog, "status:damaged:%s:%s\n", handle[j].disk->name, file->sub); - printf("damaged %s\n", path); + if (state->opt.verbose) { + printf("damaged %s\n", path); + } } else { fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub); - printf("unrecoverable %s\n", path); + if (state->opt.verbose) { + printf("unrecoverable %s\n", path); + } } } else if (file_flag_has(file, FILE_IS_FIXED)) { fprintf(stdlog, "status:recoverable:%s:%s\n", handle[j].disk->name, file->sub); - printf("recoverable %s\n", path); + if (state->opt.verbose) { + printf("recoverable %s\n", path); + } } else { fprintf(stdlog, "status:correct:%s:%s\n", handle[j].disk->name, file->sub); if (state->opt.verbose) { @@ -1195,7 +1205,9 @@ close_and_continue: ++recovered_error; fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, file->sub); - printf("recovered %s%s\n", disk->dir, file->sub); + if (state->opt.verbose) { + printf("recovered %s%s\n", disk->dir, file->sub); + } } } @@ -1358,7 +1370,9 @@ close_and_continue: } fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, link->sub); - printf("recovered %s%s\n", disk->dir, link->sub); + if (state->opt.verbose) { + printf("recovered %s%s\n", disk->dir, link->sub); + } } } @@ -1424,7 +1438,9 @@ close_and_continue: ++recovered_error; fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, dir->sub); - printf("recovered %s%s\n", disk->dir, dir->sub); + if (state->opt.verbose) { + printf("recovered %s%s\n", disk->dir, dir->sub); + } } } } diff --git a/snapraid.1 b/snapraid.1 index 1c096131..64bd4d29 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -506,6 +506,9 @@ if the error is a recoverable one or not. If you use the \(hya, \(hy\(hyaudit\(hyonly option, only the file data is checked, and the redundandy data is ignored. .PP +If you specify \(hyv, \(hy\(hyverbose it prints the list of recoverable +files. +.PP Files are identified by path, and checked by content. .PP Nothing is modified. @@ -520,6 +523,9 @@ update the new state of the files. All the files that cannot be fixed are renamed adding the \(a".unrecoverable\(a" extension. .PP +If you specify \(hyv, \(hy\(hyverbose it prints the list of recovered +files. +.PP The \(a"content\(a" file is NOT modified. The \(a"parity\(a" files are modified if necessary. The files in the array are modified if necessary. diff --git a/snapraid.d b/snapraid.d index f5622c79..ee37d0e5 100644 --- a/snapraid.d +++ b/snapraid.d @@ -287,6 +287,9 @@ Commands If you use the -a, --audit-only option, only the file data is checked, and the redundandy data is ignored. + If you specify -v, --verbose it prints the list of recoverable + files. + Files are identified by path, and checked by content. Nothing is modified. @@ -302,6 +305,9 @@ Commands All the files that cannot be fixed are renamed adding the ".unrecoverable" extension. + If you specify -v, --verbose it prints the list of recovered + files. + The "content" file is NOT modified. The "parity" files are modified if necessary. The files in the array are modified if necessary.