Windows中的AWS Cli不会将文件上传到s3存储桶 [英] AWS Cli in Windows wont upload file to s3 bucket

查看:231
本文介绍了Windows中的AWS Cli不会将文件上传到s3存储桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

装有python 2.7.10和aws cli工具的Windows服务器12r2.以下作品:

Windows server 12r2 with python 2.7.10 and the aws cli tool installed. The following works:

aws s3 cp c:\a\a.txt s3://path/

我可以毫无问题地上传该文件.我想做的是将文件从映射的驱动器上载到s3存储桶,因此我尝试了此操作:

I can upload that file without problem. What I want to do is upload a file from a mapped drive to an s3 bucket, so I tried this:

aws s3 cp s:\path\file s3://path/

它有效.

现在,我想做的还是无法弄清楚的是如何不指定,而是让它抓取所有文件,以便我可以计划将其内容上载到我的s3存储桶.我试过了:

Now what I want to do and cannot figure out is how to not specify, but let it grab all file(s) so I can schedule this to upload the contents of a directory to my s3 bucket. I tried this:

aws s3 cp "s:\path\..\..\" s3://path/ --recursive --include "201512"

我收到此错误"TOO FEW ARGUMENTS"

and I get this error "TOO FEW ARGUMENTS"

最近,我想这很疯狂,因为我没有发送特定的文件,但是我不想这样做,我想使所有事情自动化.

Nearest I can guess it's mad I'm not putting a specific file to send up, but I don't want to do that, I want to automate all things.

如果有人可以告诉我我所缺少的东西,我将不胜感激.

If someone could please shed some light on what I'm missing I would really appreciate it.

谢谢

推荐答案

aws s3 cp "s:\path\..\..\" s3://path/ --recursive --include "201512" 争论太少了

aws s3 cp "s:\path\..\..\" s3://path/ --recursive --include "201512" TOO FEW ARGUMENTS

这是因为在您的命令中,双引号(")用反斜杠(\)进行了转义,因此无法正确解析本地路径(s:\path\..\..\).

This is because, in you command, double-quote(") is escaped with backslash(\), so local path(s:\path\..\..\) is not parsed correctly.

您需要做的是使用双反斜杠来转义反斜杠,即:

What you need to do is to escape backslash with double backslashes, i.e. :

aws s3 cp "s:\\path\\..\\..\\" s3://path/ --recursive --include "201512"

这篇关于Windows中的AWS Cli不会将文件上传到s3存储桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆