mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 01:16:31 -05:00
Adds a new "dup" command to find duplicates.
This commit is contained in:
parent
8585485868
commit
cec7b2f2b4
10 changed files with 193 additions and 22 deletions
10
snapraid.c
10
snapraid.c
|
|
@ -49,6 +49,7 @@ void usage(void)
|
|||
printf("Commands:\n");
|
||||
printf(" sync Syncronize the state of the array of disks\n");
|
||||
printf(" diff Show the changes that needs to be syncronized\n");
|
||||
printf(" dup Find duplicate files\n");
|
||||
printf(" check Check the array of disks\n");
|
||||
printf(" fix Fix the array of disks\n");
|
||||
printf("\n");
|
||||
|
|
@ -113,6 +114,7 @@ void signal_handler(int signal)
|
|||
#define OPERATION_CHECK 2
|
||||
#define OPERATION_FIX 3
|
||||
#define OPERATION_DRY 4
|
||||
#define OPERATION_DUP 5
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -246,6 +248,8 @@ int main(int argc, char* argv[])
|
|||
operation = OPERATION_FIX;
|
||||
} else if (strcmp(argv[optind], "dry") == 0) {
|
||||
operation = OPERATION_DRY;
|
||||
} else if (strcmp(argv[optind], "dup") == 0) {
|
||||
operation = OPERATION_DUP;
|
||||
} else {
|
||||
fprintf(stderr, "Unknown command '%s'\n", argv[optind]);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -312,6 +316,12 @@ int main(int argc, char* argv[])
|
|||
signal(SIGINT, &signal_handler);
|
||||
|
||||
state_dry(&state, blockstart, blockcount);
|
||||
} else if (operation == OPERATION_DUP) {
|
||||
state_read(&state);
|
||||
|
||||
state_filter(&state, &filterlist);
|
||||
|
||||
state_dup(&state);
|
||||
} else {
|
||||
state_read(&state);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue