Skip to content

Instantly share code, notes, and snippets.

@akisatok
Last active August 15, 2017 11:01
Show Gist options
  • Save akisatok/8741756e8196f85084c11ee592b60aab to your computer and use it in GitHub Desktop.
Save akisatok/8741756e8196f85084c11ee592b60aab to your computer and use it in GitHub Desktop.
Amazon Drive をコマンドラインから操作する rclone の設定と利用方法 ref: http://qiita.com/_akisato/items/f4b36e86fcf7ae665b4d
$ mkdir -p rclone
$ curl -O https://downloads.rclone.org/rclone-current-osx-amd64.zip
$ unzip -a rclone-current-osx-amd64.zip
$ cd rclone-*-osx-amd64
(* にはバージョンが入る.2017年7月末現在ではv1.37のはず.)
# sudo mv rclone /usr/local/bin/
# cd ..
# rm -rf rclone-*-osx-amd64 rclone-current-osx-amd64.zip
# rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> acd
Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / FTP Connection
\ "ftp"
7 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
8 / Google Drive
\ "drive"
9 / Hubic
\ "hubic"
10 / Local Disk
\ "local"
11 / Microsoft OneDrive
\ "onedrive"
12 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
13 / SSH/SFTP Connection
\ "sftp"
14 / Yandex Disk
\ "yandex"
Storage> 1
Amazon Application Client Id - required.
client_id> rclone
Amazon Application Client Secret - required.
client_secret> acd
Auth server URL - leave blank to use Amazon's.
auth_url> https://quixotic-module-170120.appspot.com/auth
Token server url - leave blank to use Amazon's.
token_url> https://quixotic-module-170120.appspot.com/token
Remote config
Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> y
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
--------------------
[acd]
client_id = rclone
client_secret = acd
auth_url = https://quixotic-module-170120.appspot.com/auth
token_url = https://quixotic-module-170120.appspot.com/token
token = XXXX
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
# rclone lsd acd:
# rclone lsl acd:
# rclone mkdir /Users/akisato/rclone-test
(ローカル側でのディレクトリ作成)
# rclone mkdir acd:rclone-test
   (リモート側でのディレクトリ作成)
# rclone copy /Users/akisato/rclone-test/test.txt acd:rclone-test/
# rclone copy acd:rclone-test/test.txt /Users/akisato/rclone-test/
# find /Users/akisato/rclone-test -name "*.txt" | xargs -n1 -L1 -I{} rclone copy {} acd:rclone-test/
# rclone sync /Users/akisato/rclone-test acd:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment