Skip to content

Commit

Permalink
follow-up
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Jan 13, 2024
1 parent 6560fb8 commit f9257f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
22 changes: 13 additions & 9 deletions cmd/cli/cli/bucket_hdlr.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ var listAnyUsage = "list buckets, objects in buckets, and files in " + archExts
indent1 + "\t* ais ls s3 --summary --all \t- generate summary report for all s3 buckets; include remote objects and buckets that are _not present_\n" +
indent1 + "\t* ais ls s3 --summary --all --dont-add\t- same as above but without adding _non-present_ remote buckets to cluster's BMD"

var copyBucketUsage = "copy entire bucket or selected objects (to select, use '--list', '--template', or '--prefix'), e.g.:\n" +
indent1 + "\t- 'ais cp gs://webdaset-coco ais://dst'\t- copy entire Cloud bucket;\n" +
indent1 + "\t- 'ais cp s3://abc ais://nnn --all'\t- copy entire Cloud bucket that may not be _present_ in the cluster;\n" +
indent1 + "\t- 'ais cp s3://abc gs://xyz --all'\t- copy Cloud bucket to another Cloud;\n" +
indent1 + "\t- 'ais cp s3://abc ais://nnn --latest'\t- copy Cloud bucket, and make sure that already present in-cluster copies are updated to the latest (remote) versions;\n" +
indent1 + "\t- 'ais cp s3://abc ais://nnn --sync'\t- same as above, but in addition delete in-cluster copies that do not exist (any longer) in the remote source\n" +
indent1 + "with template, prefix, and/or progress bar:\n" +
indent1 + "\t- 'ais cp ais://nnn/111 ais://mmm'\t- copy a single object (assuming, prefix '111' corresponds to a single object);\n" +
indent1 + "\t- 'ais cp gs://webdataset-coco ais:/dst --template d-tokens/shard-{000000..000999}.tar.lz4'\t- copy up to 1000 objects that share the specified prefix;\n" +
indent1 + "\t- 'ais cp gs://webdataset-coco ais:/dst --prefix d-tokens/ --progress --all'\t- show progress while copying virtual subdirectory 'd-tokens'"

var (
// flags
bucketCmdsFlags = map[string][]cli.Flag{
Expand Down Expand Up @@ -179,15 +190,8 @@ var (
BashComplete: bucketCompletions(bcmplop{multiple: true}),
}
bucketCmdCopy = cli.Command{
Name: commandCopy,
Usage: "copy entire bucket or selected objects (to select, use '--list', '--template', or '--prefix'), e.g.:\n" +
indent1 + "\t- 'ais cp gs://webdaset-coco ais://dst'\t- copy entire Cloud bucket;\n" +
indent1 + "\t- 'ais cp s3://abc ais://nnn --all'\t- copy entire Cloud bucket that may not be _present_ in the cluster;\n" +
indent1 + "\t- 'ais cp s3://abc gs://xyz --all'\t- copy Cloud bucket to another Cloud;\n" +
indent1 + "\t- 'ais cp s3://abc ais://nnn --latest'\t- copy Cloud bucket, and make sure that already present in-cluster copies are updated to the latest (remote) versions;\n" +
indent1 + "\t- 'ais cp s3://abc ais://nnn --sync'\t- same as above, but in addition delete in-cluster copies that do not exist (any longer) in the source bucket\n" +
indent1 + "with template, prefix, and/or progress bar:\n" +
indent1 + "\t- 'ais cp gs://webdataset-coco ais:/dst --prefix d-tokens/ --progress --all'\t- show progress while copying virtual subdirectory 'd-tokens'",
Name: commandCopy,
Usage: copyBucketUsage,
ArgsUsage: bucketObjectSrcArgument + " " + bucketDstArgument,
Flags: bucketCmdsFlags[commandCopy],
Action: copyBucketHandler,
Expand Down
4 changes: 3 additions & 1 deletion docs/cli/bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,9 @@ NAME:
- 'ais cp s3://abc ais://nnn --latest' - copy Cloud bucket, and make sure that already present in-cluster copies are updated to the latest (remote) versions;
- 'ais cp s3://abc ais://nnn --sync' - same as above, but in addition delete in-cluster copies that do not exist (any longer) in the source bucket
with template, prefix, and/or progress bar:
- 'ais cp gs://webdataset-coco ais:/dst --prefix d-tokens/ --progress --all' - show progress while copying virtual subdirectory 'd-tokens'
- 'ais cp ais://nnn/111 ais://mmm' - copy a single object (assuming, prefix '111' corresponds to a single object);
- 'ais cp gs://webdataset-coco ais:/dst --template d-tokens/shard-{000000..000999}.tar.lz4' - copy up to 1000 objects that share the specified prefix;
- 'ais cp gs://webdataset-coco ais:/dst --prefix d-tokens/ --progress --all' - show progress while copying virtual subdirectory 'd-tokens'

USAGE:
ais cp [command options] SRC_BUCKET[/OBJECT_NAME_or_TEMPLATE] DST_BUCKET
Expand Down

0 comments on commit f9257f3

Please sign in to comment.