aws s3 cli not working in window task scheduler

0

I try to run the following aws cli command in console it working correctly. I have aws access key and secret configured.

aws s3 sync "C:\uploadfolder" s3://uploadfolder

However, when i run it inside windows task scheduler in windows 10 as well as windows server 2012, I got the following error: cannot find the file specified 0x80070002

It does not seems like it is a corrupted profile because it does not work for both windows and other command is running as expected.

Is there any step that I miss out? or any other special command needed when run aws cli in window task scheduler.

windows
amazon-web-services
amazon-s3
windows-10
asked on Stack Overflow Nov 30, 2018 by stackdisplay

1 Answer

0

Your cli command is attempting to sync a FILE called "uploadfolder". You need to change to the directory first, then run the command. Your command should instead be:

cd C:\uploadfolder
aws s3 sync . s3://uploadfolder/

This will recursively copy all files in your local directory that are not in your s3 bucket. If you would also like the sync command to delete files that are no longer in the local directory, you also need to add the --delete flag.

aws s3 sync . s3://uploadfolder/ --delete
answered on Stack Overflow Nov 30, 2018 by PrestonM

User contributions licensed under CC BY-SA 3.0