From de977af2e8d95fec7610447cd58fae5d1e694e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E7=AB=9E=E5=AE=81?= Date: Thu, 8 Sep 2022 14:02:42 +0800 Subject: [PATCH] feat: readme doc --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- cmd/{ => acp}/main.go | 2 +- 2 files changed, 43 insertions(+), 2 deletions(-) rename cmd/{ => acp}/main.go (98%) diff --git a/README.md b/README.md index 25db72a..0ba7e6f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,43 @@ # acp -An Advanced Copy Tools, with Process Bar, Sorted Copy Order, MMap Reader and Job Report +An Advanced Copy Tools, with following extra features: +- Process bar +- Sorted copy order, to improve tape device read performance +- Multi target path, read once write many +- Read file with mmap, with small file prefetch hint +- JSON format job report +- Can use as a golang library + +# Install +``` +# Install acp +go install github.com/abc950309/acp/cmd/acp +``` + +# Usage + +``` +Usage of acp: + -n do not overwrite exist file + -notarget + do not have target, use as dir index tool + -report string + json report storage path + -target value + use target flag to give multi target path +``` + +## Example + +``` +# copy `example` dir to `target` dir +acp example target/ + +# copy `example` dir to `target` dir, and output a report to `report.json` +acp -report report.json example target/ + +# copy `example` dir to `target1` and `target2` dir +acp example -target target1 -target target2 + +# do not copy, just get a dir index, write to `report.json` +acp example -notarget -report report.json +``` diff --git a/cmd/main.go b/cmd/acp/main.go similarity index 98% rename from cmd/main.go rename to cmd/acp/main.go index 94848a5..29b8f3c 100644 --- a/cmd/main.go +++ b/cmd/acp/main.go @@ -13,7 +13,7 @@ import ( var ( notOverwrite = flag.Bool("n", false, "not overwrite exist file") - noTarget = flag.Bool("notarget", false, "do not have target, aka sha256") + noTarget = flag.Bool("notarget", false, "do not have target, use as dir index tool") reportPath = flag.String("report", "", "json report storage path") targetPaths []string )