This is tricky! You can used named profiles with rclone by using env_auth=true
and AWS_PROFILE
but as you point out this won't work if you have two profiles. You can set AWS_SHARED_CREDENTIALS_FILE
but I don't think that will work as both of the backends will read the same file.
What you really need are some more config options so you can make two different backends (s3a
and s3b
with different profile variables).
This should enable that - you'll need env_auth=true
and profile=name
Let me know if it works and if the docs look ok!
https://beta.rclone.org/branch/v1.52.2-133-ge557e6b2-fix-s3-aws-profile-beta/ (uploaded in 15-30 mins)
Here are the docs
--s3-profile
Profile to use in the shared credentials file
If env_auth = true then rclone can use a shared credentials file. This
variable controls which profile is used in that file.
If empty it will default to the environment variable "AWS_PROFILE" or
"default" if that environment variable is also not set.
- Config: profile
- Env Var: RCLONE_S3_PROFILE
- Type: string
- Default: ""
--s3-shared-credentials-file
Path to the shared credentials file
If env_auth = true then rclone can use a shared credentials file.
If this variable is empty rclone will look for the
"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty
it will default to the current user's home directory.
Linux/OSX: "$HOME/.aws/credentials"
Windows: "%USERPROFILE%\.aws\credentials"
- Config: shared_credentials_file
- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE
- Type: string
- Default: ""