yanganto / s3rs

A s3 cli client with multi configs with diffent provider
MIT License
47 stars 8 forks source link

s3rs ls/ll/info commands do not list byte counts for the files in a bucket #70

Closed omac777 closed 3 years ago

omac777 commented 3 years ago

So I recently tried the command script mode to put a file in a test bucket. I created the directory:

s3rs --config=us-east-1 mb s3://gmac/tests3rs01Feb2021/

Then I copied the file from the local source path to the destination bucket path:

s3rs --config=us-east-1 put /home/davidm/Downloads/go1.16beta1.linux-amd64.tar.gz s3://gmac/tests3rs01Feb2021/go1.16beta1.linux-amd64.tar.gz

It said the upload completed and the bash shell prompt came back.

But I try to find a why to see the byte count size on the destination bucket path and I can't find a way to do that with the s3rs ls /ll/info commands.

s3rs --config=us-east-1 ls s3://gmac/tests3rs01Feb2021/
s3rs --config=us-east-1 ll s3://gmac/tests3rs01Feb2021/go1.16beta1.linux-amd64.tar.gz
s3rs --config=us-east-1 info s3://gmac/tests3rs01Feb2021/go1.16beta1.linux-amd64.tar.gz

I was expecting to be able to do something like this:

ls -lat /home/davidm/Downloads/go*.tar*
-rw-r--r--. 1 davidm davidm 131210078 Dec 17 13:04 /home/davidm/Downloads/go1.16beta1.linux-amd64.tar.gz
-rw-rw-r--. 1 davidm davidm 124430929 Jun 11  2020 /home/davidm/Downloads/go1.15beta1.linux-amd64.tar.gz
-rw-rw-r--. 1 davidm davidm 123711003 Jun  2  2020 /home/davidm/Downloads/go1.14.4.linux-amd64.tar.gz

Even better I wish we could simply something like this and that it would work:

s3rs ds -2 s3://gmac/tests3rs01Feb2021/
s3rs dua --format Bytes aggregate s3://gmac/tests3rs01Feb2021/
s3rs du -cab s3://gmac/tests3rs01Feb2021/

Thank you for listening.

yanganto commented 3 years ago

Hi @omac777

you can use ll to show the size of the objects.

Following is the example.

s3rs aws-user > ll s3://ant-lab/te

STORAGE CLASS   MODIFIED TIME                   ETAG                                    SIZE    KEY
                                                                                                s3://ant-lab
STANDARD        2021-02-02T15:57:52.000Z        9f5af0bd0765e7c241d732b3237e09ad        10 B    s3://ant-lab/test
STANDARD        2021-02-02T15:56:07.000Z        7d6d1482fc6f2aaabb531466f54d7e84-3      11 MB   s3://ant-lab/test-orig
STANDARD        2020-11-21T10:09:39.000Z        5dd39cab1c53c2c77cd352983f9641e1        20 B    s3://ant-lab/test-s3handle
STANDARD        2021-01-20T14:34:17.000Z        24c751b7093f410c1f8e33da292fe142-2      7 MB    s3://ant-lab/test-s3handle-big
STANDARD        2021-01-23T08:07:25.000Z        51346d1bbe964b14656444db6a674158-2      7 MB    s3://ant-lab/test-s3handle-big-v4-async-1611389242
STANDARD        2020-08-11T09:54:42.000Z        f895d74af5106ce0c3d6cb008fb3b98d        304 B   s3://ant-lab/test.json

Currently, I have no CEPH server to test on the JSON response, so I haven't tested with CEPH server. If you run into issues with CEPH server, please kindly reopen this issue and email me the endpoint and the keys.
I will fix the issue with CEPH server.
Thanks for using.