Creating a folder via s3cmd (Amazon S3)

前端 未结 3 1217
既然无缘
既然无缘 2020-12-29 21:32

I am using s3cmd to upload files to my S3 server. My problem is that when a directory on the server does not exist the upload fails. How can I tell s3cmd to create the folde

3条回答
  •  抹茶落季
    2020-12-29 21:54

    If you don't want to upload a file, you can copy the special $folder$ object that s3 tools create to mark folders:

    s3cmd cp 's3://bucket/parent_$folder$' 's3://bucket/parent/child_$folder$'
    

    which creates a "child" "folder".

    It's less confusing to upload something in the child location instead:

    s3cmd put dummy s3://bucket/parent/child/dummy
    

    Hive seems to require that the full S3 path exist when creating an external table. That's why I am looking at this question :)

提交回复
热议问题