Chris Hansen
Chris Hansen

Reputation: 8685

How to set the profile when running the s3cmd sync command

When I use aws sync, I can set the profile by doimg

aws sync ./test s3://test --profile stage

The profile matches to a set of credentials. I have different credentials for each profile.

How can I use the s3cmd sync command and set a profile as I do with aws sync?

Upvotes: 7

Views: 11523

Answers (2)

Jing Xue
Jing Xue

Reputation: 419

Create a profile under the name default, and export AWS_CREDENTIAL_FILE=~/.aws/credentials. You should now be able to run s3cmd. reference

Upvotes: 2

Florent V
Florent V

Reputation: 191

It is easy, just use the -c option to select the "configuration" that you want to use.

Example:

 s3cmd -c my_stage_config sync test s3://test

The default configuration (created with --configure) is stored inside the ~/.s3cfg file.

You can copy it to new files to create different configuration profiles.

Upvotes: 13

Related Questions