Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the profile when running the s3cmd sync command

Tags:

s3cmd

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?

like image 752
Chris Hansen Avatar asked Nov 05 '15 17:11

Chris Hansen


1 Answers

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.

like image 149
Florent V Avatar answered Oct 16 '22 21:10

Florent V