Improved archive dry cli.

This commit is contained in:
Christian P. MOMON 2021-04-25 13:18:39 +02:00
parent 15b088268b
commit 6e3b0be2e3

View File

@ -55,13 +55,12 @@ public final class LogarCLI
message.appendln("Usage:");
message.appendln(" logar [ -h | -help | --help ]");
message.appendln(" logar [ -v | -version | --version ]");
message.appendln(" logar anonymize fileordirectory [mapfile] anonymize ip and user");
message.appendln(" logar archive source target archive previous month from /var/log/nginx/ tree");
message.appendln(" logar check fileordirectory check line format in log file");
message.appendln(" logar checksort fileordirectory check sort in log file");
message.appendln(" logar sort fileordirectory sort log files by datetime");
message.appendln(" logar testarchive source test archive without writing");
message.appendln(" logar testconcate fileordirectory test line concate in log file");
message.appendln(" logar anonymize fileordirectory [mapfile] anonymize ip and user");
message.appendln(" logar archive [-dry] source target archive previous month from /var/log/nginx/ tree");
message.appendln(" logar check fileordirectory check line format in log file");
message.appendln(" logar checksort fileordirectory check sort in log file");
message.appendln(" logar sort fileordirectory sort log files by datetime");
message.appendln(" logar testconcate fileordirectory test line concate in log file");
logger.info(message.toString());
}
@ -205,6 +204,13 @@ public final class LogarCLI
Logar.archive(source, target, DryOption.OFF);
}
else if (isMatching(args, "archive", "-dry", "\\s*\\S+\\s*", "\\s*\\S+\\s*"))
{
File source = new File(args[2]);
File target = new File(args[3]);
Logar.archive(source, target, DryOption.ON);
}
else if (isMatching(args, "check", "\\s*\\S+\\s*"))
{
File source = new File(args[1]);
@ -223,13 +229,6 @@ public final class LogarCLI
Logar.sort(source);
}
else if (isMatching(args, "testarchive", "\\s*\\S+\\s*", "\\s*\\S+\\s*"))
{
File source = new File(args[1]);
File target = new File(args[2]);
Logar.archive(source, target, DryOption.ON);
}
else if (isMatching(args, "testconcate", "\\s*\\S+\\s*"))
{
File source = new File(args[1]);