mirror of
https://github.com/rclone/rclone
synced 2024-11-13 12:09:47 +01:00
110 lines
2.4 KiB
Markdown
110 lines
2.4 KiB
Markdown
|
---
|
||
|
title: "Amazon S3"
|
||
|
description: "Rclone docs for Amazon S3"
|
||
|
date: "2014-03-19"
|
||
|
---
|
||
|
|
||
|
Paths are specified as `remote:bucket` or `remote:`
|
||
|
|
||
|
S3 paths can't refer to subdirectories within a bucket (yet).
|
||
|
|
||
|
So to copy a local directory to a s3 container called backup
|
||
|
|
||
|
rclone sync /home/source s3:backup
|
||
|
|
||
|
Here is an example of making an s3 configuration. First run
|
||
|
|
||
|
rclone config
|
||
|
|
||
|
This will guide you through an interactive setup process.
|
||
|
|
||
|
```
|
||
|
No remotes found - make a new one
|
||
|
n) New remote
|
||
|
q) Quit config
|
||
|
n/q> n
|
||
|
name> remote
|
||
|
What type of source is it?
|
||
|
Choose a number from below
|
||
|
1) swift
|
||
|
2) s3
|
||
|
3) local
|
||
|
4) drive
|
||
|
type> 2
|
||
|
AWS Access Key ID.
|
||
|
access_key_id> accesskey
|
||
|
AWS Secret Access Key (password).
|
||
|
secret_access_key> secretaccesskey
|
||
|
Endpoint for S3 API.
|
||
|
Choose a number from below, or type in your own value
|
||
|
* The default endpoint - a good choice if you are unsure.
|
||
|
* US Region, Northern Virginia or Pacific Northwest.
|
||
|
* Leave location constraint empty.
|
||
|
1) https://s3.amazonaws.com/
|
||
|
* US Region, Northern Virginia only.
|
||
|
* Leave location constraint empty.
|
||
|
2) https://s3-external-1.amazonaws.com
|
||
|
[snip]
|
||
|
* South America (Sao Paulo) Region
|
||
|
* Needs location constraint sa-east-1.
|
||
|
9) https://s3-sa-east-1.amazonaws.com
|
||
|
endpoint> 1
|
||
|
Location constraint - must be set to match the Endpoint.
|
||
|
Choose a number from below, or type in your own value
|
||
|
* Empty for US Region, Northern Virginia or Pacific Northwest.
|
||
|
1)
|
||
|
* US West (Oregon) Region.
|
||
|
2) us-west-2
|
||
|
[snip]
|
||
|
* South America (Sao Paulo) Region.
|
||
|
9) sa-east-1
|
||
|
location_constraint> 1
|
||
|
--------------------
|
||
|
[remote]
|
||
|
access_key_id = accesskey
|
||
|
secret_access_key = secretaccesskey
|
||
|
endpoint = https://s3.amazonaws.com/
|
||
|
location_constraint =
|
||
|
--------------------
|
||
|
y) Yes this is OK
|
||
|
e) Edit this remote
|
||
|
d) Delete this remote
|
||
|
y/e/d> y
|
||
|
Current remotes:
|
||
|
|
||
|
Name Type
|
||
|
==== ====
|
||
|
remote s3
|
||
|
|
||
|
e) Edit existing remote
|
||
|
n) New remote
|
||
|
d) Delete remote
|
||
|
q) Quit config
|
||
|
e/n/d/q> q
|
||
|
```
|
||
|
|
||
|
This remote is called `remote` and can now be used like this
|
||
|
|
||
|
See all buckets
|
||
|
|
||
|
rclone lsd remote:
|
||
|
|
||
|
Make a new bucket
|
||
|
|
||
|
rclone mkdir remote:bucket
|
||
|
|
||
|
List the contents of a bucket
|
||
|
|
||
|
rclone ls remote:bucket
|
||
|
|
||
|
Sync `/home/local/directory` to the remote bucket, deleting any excess
|
||
|
files in the bucket.
|
||
|
|
||
|
rclone sync /home/local/directory remote:bucket
|
||
|
|
||
|
Modified time
|
||
|
-------------
|
||
|
|
||
|
The modified time is stored as metadata on the object as
|
||
|
`X-Amz-Meta-Mtime` as floating point since the epoch accurate to 1 ns.
|