From 7992ca1a77d83a79dee2006719dde06731b0ac9c Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 14 Feb 2016 10:37:44 +0100 Subject: [PATCH] Extend the diff manual and reorder the final summary --- cmdline/scan.c | 12 ++++++------ snapraid.1 | 37 +++++++++++++++++++++++++++++++++++++ snapraid.d | 19 +++++++++++++++++++ snapraid.txt | 19 +++++++++++++++++++ 4 files changed, 81 insertions(+), 6 deletions(-) diff --git a/cmdline/scan.c b/cmdline/scan.c index 881773e4..e37da434 100644 --- a/cmdline/scan.c +++ b/cmdline/scan.c @@ -1811,20 +1811,20 @@ static int state_diffscan(struct snapraid_state* state, int is_diff) } msg("%8u equal\n", total.count_equal); + msg("%8u added\n", total.count_insert); + msg("%8u removed\n", total.count_remove); + msg("%8u updated\n", total.count_change); msg("%8u moved\n", total.count_move); msg("%8u copied\n", total.count_copy); msg("%8u restored\n", total.count_restore); - msg("%8u updated\n", total.count_change); - msg("%8u removed\n", total.count_remove); - msg("%8u added\n", total.count_insert); log_tag("summary:equal:%u\n", total.count_equal); + log_tag("summary:added:%u\n", total.count_insert); + log_tag("summary:removed:%u\n", total.count_remove); + log_tag("summary:updated:%u\n", total.count_change); log_tag("summary:moved:%u\n", total.count_move); log_tag("summary:copied:%u\n", total.count_copy); log_tag("summary:restored:%u\n", total.count_restore); - log_tag("summary:updated:%u\n", total.count_change); - log_tag("summary:removed:%u\n", total.count_remove); - log_tag("summary:added:%u\n", total.count_insert); no_difference = !total.count_move && !total.count_copy && !total.count_restore && !total.count_change && !total.count_remove && !total.count_insert; diff --git a/snapraid.1 b/snapraid.1 index 86575efd..315bdb34 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -750,6 +750,43 @@ their parity data recomputed. This command doesn\'t check the file data, but only the file time\-stamp size and inode. .PP +At the end of the command, you\'ll get a summary of the file changes +grouped by: +.RS 4 +.PD 0 +.HP 4 +.I equal +Files equal at before. +.HP 4 +.I added +Files added that were not present before. +.HP 4 +.I removed +Files removed. +.HP 4 +.I updated +Files with a different size or time\-stamp, meaning that +they were modified. +.HP 4 +.I moved +Files moved to a different directory of the same disk. +They are identified by having the same name, size, time\-stamp +and inode, but different directory. +.HP 4 +.I copied +Files copied in the same or different disk. Note that if in +true they are moved to a different disk, you\'ll also have +them counted in \[dq]removed\[dq]. +They are identified by having the same name, size, and +time\-stamp. But if the sub\-second time\-stamp is zero, +then the full path should match, and not only the name. +.HP 4 +.I restored +Files with a different inode but with name, size and time\-stamp +matching. These are usually files restored after being deleted. +.PD +.RE +.PP If a \[dq]sync\[dq] is required, the process return code is 2, instead of the default 0. The return code 1 is instead for a generic error condition. .PP diff --git a/snapraid.d b/snapraid.d index 59a2c112..d333445a 100644 --- a/snapraid.d +++ b/snapraid.d @@ -456,6 +456,25 @@ Commands This command doesn't check the file data, but only the file time-stamp size and inode. + At the end of the command, you'll get a summary of the file changes + grouped by: + equal - Files equal at before. + added - Files added that were not present before. + removed - Files removed. + updated - Files with a different size or time-stamp, meaning that + they were modified. + moved - Files moved to a different directory of the same disk. + They are identified by having the same name, size, time-stamp + and inode, but different directory. + copied - Files copied in the same or different disk. Note that if in + true they are moved to a different disk, you'll also have + them counted in "removed". + They are identified by having the same name, size, and + time-stamp. But if the sub-second time-stamp is zero, + then the full path should match, and not only the name. + restored - Files with a different inode but with name, size and time-stamp + matching. These are usually files restored after being deleted. + If a "sync" is required, the process return code is 2, instead of the default 0. The return code 1 is instead for a generic error condition. diff --git a/snapraid.txt b/snapraid.txt index 56fc09e8..34e3c54d 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -490,6 +490,25 @@ their parity data recomputed. This command doesn't check the file data, but only the file time-stamp size and inode. +At the end of the command, you'll get a summary of the file changes +grouped by: + equal - Files equal at before. + added - Files added that were not present before. + removed - Files removed. + updated - Files with a different size or time-stamp, meaning that + they were modified. + moved - Files moved to a different directory of the same disk. + They are identified by having the same name, size, time-stamp + and inode, but different directory. + copied - Files copied in the same or different disk. Note that if in + true they are moved to a different disk, you'll also have + them counted in "removed". + They are identified by having the same name, size, and + time-stamp. But if the sub-second time-stamp is zero, + then the full path should match, and not only the name. + restored - Files with a different inode but with name, size and time-stamp + matching. These are usually files restored after being deleted. + If a "sync" is required, the process return code is 2, instead of the default 0. The return code 1 is instead for a generic error condition.