如何以编程方式下载 Sagemaker 笔记本实例中的文件?

How do I download files within a Sagemaker notebook instance programatically?

我们在 Sagemaker 中有一个笔记本实例,其中包含许多 Jupyter Python 脚本。我想编写一个程序,每天下载这些不同的脚本(即我可以备份它们)。不幸的是,我在 AWS CLI API.

中没有看到任何对此的引用

这可以实现吗?

这不完全是你想要的,但看起来像 VCS can fit your needs. You can use Github(if you already use it) or CodeCommit(free privat repos) Details and additional ways like sync target dir with S3 bucket - https://aws.amazon.com/blogs/machine-learning/how-to-use-common-workflows-on-amazon-sagemaker-notebook-instances/

半自动方式:

conda install -y -c conda-forge zip
!zip -r -X folder.zip folder-to-zip

然后下载该 zip 文件。