How do I delete/count objects in a s3 bucket?

前端 未结 6 729
借酒劲吻你
借酒劲吻你 2021-02-01 10:15

So I know this is a common question but there just doesn\'t seem to be any good answers for it.

I have a bucket with gobs (I have no clue how many) number of files in th

6条回答
  •  借酒劲吻你
    2021-02-01 10:44

    "List" won't retrieve the data. I use s3cmd (a python script) and I would have done something like this:

    s3cmd ls s3://foo | awk '{print $4}' | split -a 5 -l 10000 bucketfiles_
    for i in bucketfiles_*; do xargs -n 1 s3cmd rm < $i & done
    

    But first check how many bucketfiles_ files you get. There will be one s3cmd running per file.

    It will take a while, but not days.

提交回复
热议问题