bài trước, chúng ta đã tìm hiểu cách cấu hình rclone kết nối qua tài khoản ftp.

Bài viết này sẽ hướng dẫn cách cấu hình rclone với dropbox.

Nếu chưa cài đặt rclone, bạn tham khảo thêm bài viết hướng dẫn cài đặt rclone nhé.

Để bắt đầu, thực hiện lệnh:

rclone config

Nhập n (New remote) để tạo kết nối mới.

Dòng name sẽ nhập tên của kết nối, trong ví dụ này tên kết nối sẽ là dropbox.

Danh sách các dịch vụ lưu trữ đám mây hiển thị, nhập 9 để chọn dropbox.

Tiếp theo chương trình yêu cầu nhập client_idclient_secret, để trống và chuyển bước tiếp theo bằng cách Enter.

Sau đó, tại dòng Edit advanced config? để trống bằng cách Enter để chọn giá trị mặc định là No (hoặc nhập n).

Dòng Remote config, nhập y để chọn cấu hình tự động.

Chương trình gửi một link xác thực để truy cập dropbox của bạn, click Allow để cấp quyền truy cập vào dropbox cho rclone.

Thông báo thành công trên trình duyệt như dưới đây:

Chương trình tiếp tục xác nhận lần cuối cùng với người dùng các thông tin đã nhập phía trên, Enter để chọn giá trị mặc định yes.

Output của quá trình cấu hình kết nối rclone với dropbox như sau:

phuongdm@Phuongdm-PC:~$ rclone config 
Current remotes:

Name                 Type
====                 ====
ftp                  ftp
ggdrive              drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n
name> dropbox 
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / 1Fichier
   \ "fichier"
 2 / Alias for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, Tencent COS, etc)
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Citrix Sharefile
   \ "sharefile"
 9 / Dropbox
   \ "dropbox"
10 / Encrypt/Decrypt a remote
   \ "crypt"
11 / FTP Connection
   \ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
13 / Google Drive
   \ "drive"
14 / Google Photos
   \ "google photos"
15 / Hubic
   \ "hubic"
16 / In memory object storage system.
   \ "memory"
17 / Jottacloud
   \ "jottacloud"
18 / Koofr
   \ "koofr"
19 / Local Disk
   \ "local"
20 / Mail.ru Cloud
   \ "mailru"
21 / Mega
   \ "mega"
22 / Microsoft Azure Blob Storage
   \ "azureblob"
23 / Microsoft OneDrive
   \ "onedrive"
24 / OpenDrive
   \ "opendrive"
25 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
26 / Pcloud
   \ "pcloud"
27 / Put.io
   \ "putio"
28 / QingCloud Object Storage
   \ "qingstor"
29 / SSH/SFTP Connection
   \ "sftp"
30 / Sugarsync
   \ "sugarsync"
31 / Tardigrade Decentralized Cloud Storage
   \ "tardigrade"
32 / Transparently chunk/split large files
   \ "chunker"
33 / Union merges the contents of several upstream fs
   \ "union"
34 / Webdav
   \ "webdav"
35 / Yandex Disk
   \ "yandex"
36 / http Connection
   \ "http"
37 / premiumize.me
   \ "premiumizeme"
38 / seafile
   \ "seafile"
Storage> 9
** See help for dropbox backend at: https://rclone.org/dropbox/ **

OAuth Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> 
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> 
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> 
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXXXX
Log in and authorize rclone for access
Waiting for code...
Got code
--------------------
[dropbox]
type = dropbox
token = {"access_token":"","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
dropbox              dropbox
ftp                  ftp
ggdrive              drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>

Vậy là chúng ta kết nối thành công với dropbox bằng rclone.

Để kiểm tra hoạt động của rclone, chúng ta có thể sử dụng lệnh sau để liệt kê các file trên dropbox:

phuongdm@Phuongdm-PC:~$ rclone ls dropbox:
      240 Get Started with Dropbox Paper.url
  1102331 Get Started with Dropbox.pdf

Kiểm tra tài nguyên của dropbox bằng rclone:

phuongdm@Phuongdm-PC:~$ rclone about dropbox:
Total:   2G
Used:    1.051M
Free:    1.999G

Kiểm tra file trên dropbox:

Một số bài viết liên quan: