Exclude folders for s3cmd sync

前端 未结 2 1806
感动是毒
感动是毒 2021-01-12 06:40

I am using s3cmd and i would like to know how to exclude all folders within a bucket and just sync the bucket root.

for example

bucket
folder/two/
fo         


        
相关标签:
2条回答
  • 2021-01-12 07:05

    As mentioned by @physiocoder excluding a folder is done the following way:

    s3cmd --exclude 'foldername/*'

    So that is different from the question but I landed on this page due to its title.

    0 讨论(0)
  • 2021-01-12 07:29

    You should indeed use the --exclude option. If you want to sync every file on the root but not the folders, you should try :

    s3cmd --exclude="/*/*" sync local/ s3://s3bucket
    

    Keep in mind that a folder doesn't really exist on S3. What seems to be a file file in a folder folder is just a file named folder/file! So you just have to exclude file with the pattern /*/*.

    0 讨论(0)
提交回复
热议问题