0
votes

I'm new to AWS CLI (and programming), but I've looked through documentation and posted questions and can't find this addressed, I must be missing something basic?

How do I save the output? I'd like to run AWS S3 Sync to backup my data overnight, and I'd like to see a log report in the morning of what happened.

At this point, I can run AWS from a command prompt:

aws s3 sync "my local directory" s3://mybucket

I've set output format to Text in the config. But I'm only seeing the text in the command prompt. How can I export it as a log file?

Is this not possible, what am I missing?

Many thanks in advance, Matthew

3
Well I figured it out. I just added >C:\Logs\MyLogName.txt to the end of the command. - Matthew
You should mark your question as answered - Jordon Phillips

3 Answers

3
votes
aws s3 sync "my local directory" s3://mybucket --debug 2> "local path\logname.txt"
0
votes

Not only did I figure out adding > filename to the end of the command, but I also figured out that when saving this as a batch file, it won't run as a scheduled task in Windows Server 2008 r2, or Windows 7, if it contains drive mappings. UNC paths are required.

Thanks! Matthew

0
votes

this perfectly worked for me

aws cloudformation describe-stack-events --stack-name "stack name" --debug 2> "C:\Users\ravi\Desktop\CICDWORKFolder\RedshiftFolder\logname.txt"