Changes again the output of check/fix.

Now the file name are printed unless the undocumented -q is specified.
This commit is contained in:
Andrea Mazzoleni 2013-10-31 18:41:10 +01:00
parent 40ee711a6e
commit 066709370e
7 changed files with 15 additions and 48 deletions

View file

@ -96,7 +96,7 @@ maintainer-clean-local:
# Automatic testing
CHECKFLAGS = --test-skip-device --test-skip-self
CHECKFLAGS = --test-skip-device --test-skip-self -q
CHECKCOUNT = 2000
CHECKSIZE = 4000
CONF = $(srcdir)/test-raidHP.conf

16
check.c
View file

@ -1002,7 +1002,7 @@ 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);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("unrecoverable %s\n", path);
}
@ -1017,7 +1017,7 @@ 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);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("recovered %s\n", path);
}
@ -1059,18 +1059,18 @@ 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);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("damaged %s\n", path);
}
} else {
fprintf(stdlog, "status:unrecoverable:%s:%s\n", handle[j].disk->name, file->sub);
if (state->opt.verbose) {
if (!state->opt.quiet) {
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);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("recoverable %s\n", path);
}
} else {
@ -1205,7 +1205,7 @@ close_and_continue:
++recovered_error;
fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, file->sub);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("recovered %s%s\n", disk->dir, file->sub);
}
}
@ -1370,7 +1370,7 @@ close_and_continue:
}
fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, link->sub);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("recovered %s%s\n", disk->dir, link->sub);
}
}
@ -1438,7 +1438,7 @@ close_and_continue:
++recovered_error;
fprintf(stdlog, "status:recovered:%s:%s\n", disk->name, dir->sub);
if (state->opt.verbose) {
if (!state->opt.quiet) {
printf("recovered %s%s\n", disk->dir, dir->sub);
}
}

View file

@ -282,16 +282,6 @@ snapraid fix
Note that the fix command will revert your data at the state of the
last \(a"sync\(a" command executed. It works like a snapshot was taken
in \(a"sync\(a".
.PP
To see the list of files meanwhile they are checked and fixed, you can
used the \(hyv, \(hy\(hyverbose option. Like:
.PP
.RS 4
snapraid fix \(hyv
.PD 0
.PP
.PD
.RE
.SS Recovering and Undeleting
In recovering SnapRAID is more like a backup program than a RAID system,
and it can be used to restore or undelete only a single file or directory
@ -506,9 +496,6 @@ 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.
@ -523,9 +510,6 @@ 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.
@ -1186,8 +1170,6 @@ Where NAME is the name of the disk, like \(a"d1\(a" as in our previous example.
.PP
This command will take a long time.
.PP
You can also add the \(a"\(hyv\(a" option to see on the console the fixed files.
.PP
Take care that you need also few gigabytes free to store the fix.log file.
Run it from a disk with some free space.
.PP

View file

@ -127,6 +127,7 @@ struct option long_options[] = {
{ "speed-test", 0, 0, 'T' },
{ "gen-conf", 1, 0, 'C' },
{ "verbose", 0, 0, 'v' },
{ "quiet", 0, 0, 'q' },
{ "gui", 0, 0, 'G' }, /* undocumented GUI interface command */
{ "help", 0, 0, 'h' },
{ "version", 0, 0, 'V' },
@ -188,7 +189,7 @@ struct option long_options[] = {
};
#endif
#define OPTIONS "c:f:d:mep:o:s:t:i:l:ZEUDNaTC:vhVG"
#define OPTIONS "c:f:d:mep:o:s:t:i:l:ZEUDNaTC:vqhVG"
volatile int global_interrupt = 0;
@ -356,6 +357,9 @@ int main(int argc, char* argv[])
case 'v' :
opt.verbose = 1;
break;
case 'q' :
opt.quiet = 1;
break;
case 'G' :
opt.gui = 1;
break;

View file

@ -160,11 +160,6 @@ Getting Started
last "sync" command executed. It works like a snapshot was taken
in "sync".
To see the list of files meanwhile they are checked and fixed, you can
used the -v, --verbose option. Like:
:snapraid fix -v
Recovering and Undeleting
In recovering SnapRAID is more like a backup program than a RAID system,
and it can be used to restore or undelete only a single file or directory
@ -287,9 +282,6 @@ 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.
@ -305,9 +297,6 @@ 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.
@ -841,8 +830,6 @@ Recovering
This command will take a long time.
You can also add the "-v" option to see on the console the fixed files.
Take care that you need also few gigabytes free to store the fix.log file.
Run it from a disk with some free space.

View file

@ -175,11 +175,6 @@ Note that the fix command will revert your data at the state of the
last "sync" command executed. It works like a snapshot was taken
in "sync".
To see the list of files meanwhile they are checked and fixed, you can
used the -v, --verbose option. Like:
snapraid fix -v
4.2 Recovering and Undeleting
-----------------------------
@ -911,8 +906,6 @@ Where NAME is the name of the disk, like "d1" as in our previous example.
This command will take a long time.
You can also add the "-v" option to see on the console the fixed files.
Take care that you need also few gigabytes free to store the fix.log file.
Run it from a disk with some free space.

View file

@ -57,6 +57,7 @@ extern volatile int global_interrupt;
*/
struct snapraid_option {
int verbose; /**< Verbose output. */
int quiet; /**< Quiet output. */
int gui; /**< Gui output. */
int force_zero; /**< Forced dangerous operations of synching files now with zero size. */
int force_empty; /**< Forced dangerous operations of synching disks now empty. */