aws cli 上传文件到s3命令,Windows中的AWS Cli不会将文件上传到s3存储桶

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/

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/

and it works.

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"

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.

Thank you

解决方案aws s3 cp "s:\path\..\..\" s3://path/ --recursive --include "201512"

TOO FEW ARGUMENTS

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"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值