John Snow
John Snow

Reputation: 2018

Use current working directory as path with AWS Cli

I'm attempting to sync my bucket from my local directory using AWS Cli on Windows.

It works using the command

aws s3 sync C:\[long path name] s3://[bucket name]

I would prefer to replace the path name with something shorter or just associate it with the bucket. I've tried chdir and cd. Is there an easy way to do this?

Upvotes: 0

Views: 3204

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269101

If you wish to synchronize the current directory to an Amazon S3 bucket, use:

aws s3 sync . s3://[bucket name]

Or to sync to a directory within the S3 bucket:

aws s3 sync . s3://[bucket name]/[path]

The same syntax works on Windows and Linux.

Upvotes: 4

Related Questions