将一组特定文件从 Amazon S3 同步到 Dropbox 或 Amazon Drive
Sync a specific set of files from Amazon S3 to Dropbox or Amazon Drive
我有一个包含大量图像的 Amazon S3 存储桶。这些图像的一个子集需要同步到本地机器以进行图像分析 (AI)。这必须定期完成,最好使用文件名列表作为输入。并非所有图像都需要同步。
有一些方法可以将 S3 与 Dropbox/Amazon 驱动器或其他存储服务同步,但其中 none 似乎可以选择提供需要同步的文件列表。
如何实施?
谈到同步和 s3 时首先想到的是使用 aws s3 sync cli 命令。这将允许您同步特定的源目标文件夹,并让您能够使用 --include、--exclude 如果你想列出特定文件。如果您有可用于识别文件的特定命名约定,这些命令还允许使用通配符 [*]。
您还可以为多个文件重复调用 --exclude 命令,因此根据您的 OS 您可以列出所有文件或创建一个 find 脚本来识别文件并单独列出它们出。
此外,您还可以执行 --delete,这将删除目标路径中不在源路径中的所有文件。
As much as I would like to answer but I felt it would be good to
comment with one's thoughts initially if they are in line with the OP!
But I see the comments are being used to provide an answer to gain
points :)
I would like to submit my official answer!
答案:
如果我理解正确,我会使用 aws cli
包含和排除过滤器。
https://docs.aws.amazon.com/cli/latest/reference/s3/index.html#use-of-exclude-and-include-filters
我有一个包含大量图像的 Amazon S3 存储桶。这些图像的一个子集需要同步到本地机器以进行图像分析 (AI)。这必须定期完成,最好使用文件名列表作为输入。并非所有图像都需要同步。
有一些方法可以将 S3 与 Dropbox/Amazon 驱动器或其他存储服务同步,但其中 none 似乎可以选择提供需要同步的文件列表。
如何实施?
谈到同步和 s3 时首先想到的是使用 aws s3 sync cli 命令。这将允许您同步特定的源目标文件夹,并让您能够使用 --include、--exclude 如果你想列出特定文件。如果您有可用于识别文件的特定命名约定,这些命令还允许使用通配符 [*]。
您还可以为多个文件重复调用 --exclude 命令,因此根据您的 OS 您可以列出所有文件或创建一个 find 脚本来识别文件并单独列出它们出。
此外,您还可以执行 --delete,这将删除目标路径中不在源路径中的所有文件。
As much as I would like to answer but I felt it would be good to comment with one's thoughts initially if they are in line with the OP!
But I see the comments are being used to provide an answer to gain points :)
I would like to submit my official answer!
答案:
如果我理解正确,我会使用 aws cli
包含和排除过滤器。
https://docs.aws.amazon.com/cli/latest/reference/s3/index.html#use-of-exclude-and-include-filters