aws s3 command does not work in a batch file triggered by a Windows task scheduler

后端 未结 4 1159
谎友^
谎友^ 2021-01-01 01:50

I have a batch file C:\\upload_to_s3.bat. In this file, there is a line:

aws s3 sync D:\\S3\\batch1\\ s3://MyBucket/batch1 --exclude *.bat

I have Windows tas

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 02:38

    i was able to solve the problem by adding the following 3 lines in the batch file BEFORE your s3 command

    aws configure set AWS_ACCESS_KEY_ID 
    aws configure set AWS_SECRET_ACCESS_KEY 
    aws configure set default.region eu-west-1
    

    replace the stuff between angled brackets with your data and the region with your bucket's region. and yes ,there is no equal sign between "AWS_ACCESS_KEY_ID" and the key.

提交回复
热议问题