install s3cmd

sudo apt-get install s3cmd

S3 Configure

s3cmd --configure

Default Vultr , DigitalOcean & AWS laravel .env

AWS_ACCESS_KEY_ID=xxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxx
AWS_DEFAULT_REGION=sgp1
AWS_BUCKET=test
AWS_URL=https://test.sgp1.vultrobjects.com
AWS_ENDPOINT=https://sgp1.vultrobjects.com

Public S3 policy file policy.json

{
    "Version": "2012-10-17",
		"Id":"123",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::test/*"
        },
				{
						"Sid": "RemovePerm",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:DeleteObject",
            "Resource": "arn:aws:s3:::test/*"
        }
    ]
}

Set policy to bucket

s3cmd setpolicy policy.json s3://bucket

Clone & Sync buckets

sudo apt-get install rclone
nano ~/.config/rclone/rclone.conf
----
[s3]
type = s3
env_auth = false
access_key_id = aws_access_key
secret_access_key = aws_secret_key
region = aws_region
location_constraint = aws_location_constraint
acl = private
----
[spaces]
type = s3
env_auth = false
access_key_id = spaces_access_key
secret_access_key = spaces_secret_key
endpoint = nyc3.digitaloceanspaces.com
acl = private
----
rclone sync s3://bucket-from-aws s3://bucket-to-another-provider

Useful links