问题描述
我使用s3cmd,我想知道如何排除一个桶中的所有文件夹,只是同步桶根。
I am using s3cmd and i would like to know how to exclude all folders within a bucket and just sync the bucket root.
例如
bucket
folder/two/
folder/two/file.jpg
get.jpg
与我只是希望它同步get.jpg而忽略了文件夹及其内容同步。
with the sync i just want it to sync the get.jpg and ignore the folder and its contents.
s3cmd --config sync s3://s3bucket (only sync root) local/
如果有人能够帮助这将是惊人的我已经尝试过--exclude但不知道如何使用它在这种情况呢?
If someone could help that would be amazing i have already tried the --exclude but not sure how to use it in this situation?
推荐答案
您确实应该使用 - 排除
选项。如果要同步根的每个文件而不是文件夹,你应该尝试:
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
请记住,一个文件夹并没有真正在S3上存在。什么似乎是一个文件文件
文件夹中文件夹
是刚刚任命的文件文件夹/文件
!所以,你只需要排除的文件模式 / * / *
。
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 /*/*
.
这篇关于排除了s3cmd同步文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!