aws sync s3 Windows计划任务返回0x1

时间:2016-11-25 17:22:38

标签: windows batch-file amazon-web-services amazon-s3 windows-scheduler

我创建了一个Windows计划任务来运行aws命令以将本地文件夹同步到S3存储桶。该任务运行.bat文件。如果手动运行.bat,它运行正常。当它通过任务运行时,我得到一个0x1作为最后一次运行结果。

根据here的建议,我的bat文件如下所示:

set AWS_CONFIG_FILE=C:\Users\xxx\.aws\config
set AWS_ACCESS_KEY_ID=xxx
set AWS_SECRET_ACCESS_KEY=xxx
aws s3 sync "C:\my_local_folder" s3://my_bucket --delete
xxx中的{p> set AWS_CONFIG_FILE=C:\Users\xxx\.aws\config.aws\config文件夹的正确路径。

我的任务如下:

enter image description here

enter image description here

enter image description here

enter image description here

正在使用的帐户是管理员帐户,已经成功运行其他计划任务,并且任务中的路径正确无误。

1 个答案:

答案 0 :(得分:1)

Courtesy @ JohnRotenstein关于重定向输出的评论,我将命令更改为:

y
相关问题