Bagi anda yang menginginkan penyimpanan secara online menggunakan google drive dan sejenisnya namun kesulitan bagaimana cara backup data secara otomatis dari google drive ke dalam server yang kita miliki mungkin tutorial ini bisa menjadi solusi bagi anda. Kita hanya memerlukan aplikasi yang bernama RCLONE.
Aplikasi ini bisa melakukan sincronisasi secara otomatis ke dalam akun google drive kita dan juga mendukung beberapa aplikasi penyimpanan cloud seperti Google drive, Amazon Drive, Dropbox, Google cloud storage, dan masih banyak lagi.
Berikut ini langkah konfigurasinya
#pindah direktori ke /usr/src (optional)
cd /usr/src
#untuk versi stabil terbaru jalankan command berikut :
curl https://rclone.org/install.sh | sudo bash
#untuk versi beta jalankan command berikut :
curl https://rclone.org/install.sh | sudo bash -s beta
#melihat versi yang di gunakan
rclone -V
#output
rclone v1.42
- os/arch: linux/amd64
- go version: go1.10.1
Tambahkan akun google drive seperti langkah berikut ini#masuk ke command rclone config
rclone config
#output
Current remotes:
Name Type
==== ====
Datab2 b2
DataWebdavCloud webdav
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>
#ketikkan 'n' untuk membuat config baru
n
#masukkan nama config
name > DataGoogleDrive
Silahkan pilih storage yang ingin di pakai
#output storage yang bisa diconfigure
Type of storage to configure.
Choose a number from below, or type in your own value
1 / Alias for a existing remote
"alias"
2 / Amazon Drive
"amazon cloud drive"
3 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
"s3"
4 / Backblaze B2
"b2"
5 / Box
"box"
6 / Cache a remote
"cache"
7 / Dropbox
"dropbox"
8 / Encrypt/Decrypt a remote
"crypt"
9 / FTP Connection
"ftp"
10 / Google Cloud Storage (this is not Google Drive)
"google cloud storage"
11 / Google Drive
"drive"
12 / Hubic
"hubic"
13 / Local Disk
"local"
14 / Mega
"mega"
15 / Microsoft Azure Blob Storage
"azureblob"
16 / Microsoft OneDrive
"onedrive"
17 / OpenDrive
"opendrive"
18 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
"swift"
19 / Pcloud
"pcloud"
20 / QingCloud Object Storage
"qingstor"
21 / SSH/SFTP Connection
"sftp"
22 / Webdav
"webdav"
23 / Yandex Disk
"yandex"
24 / http Connection
"http"
Storage>
#pilih angka sesuai cloud yang dipakai (misal google drive 11)
Storage> 11
#Masukkan Client Id, kosongkan saja
Google Application Client Id - leave blank normally.
client_id>
#Masukkan Client Secret key, Kosongkan saja
Google Application Client Secret - leave blank normally.
client_secret>
#pilih scope rclone untuk google drive
Scope that rclone should use when requesting access from drive.
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
"drive"
2 / Read-only access to file metadata and file contents.
"drive.readonly"
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
"drive.file"
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
"drive.appfolder"
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
"drive.metadata.readonly"
scope>
#pilih 1 untuk full access
scope> 1
#masukkan root folder, dikosongkan saja
ID of the root folder - leave blank normally. Fill in to access "Computers" folders. (see docs).
root_folder_id>
#masukkan Service Account Credentials, dikosongkan saja
Service Account Credentials JSON file path - leave blank normally.
Needed only if you want use SA instead of interactive login.
service_account_file>
#masukkan N jika kita login menggunakan remote headless (cth: ssh ke server)
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=202264815644.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=8e18725fe08eaa533ba7cb5a509f2c25
Log in and authorize rclone for access
Enter verification code>
Buka pada browser link yang diberikan, kemudian login ke akun google, selanjutnyacopy kembali code tadi, masukkan kembali pada bagian rclone config sebelumnya
#memasukkan code access
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=202264815644.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=8e18725fe08eaa533ba7cb5a509f2c25
Log in and authorize rclone for access
Enter verification code> 4/0TAwBjMp_9RgBFgsqxIhZXjJKEjAvoWhklk6Gj-P7TGQGhRufw4vTdp
# Masukkan Y untuk dikonfig sebagai team drive, atau N untuk tidak
Configure this as a team drive?
y) Yes
n) No
y/n> n
#output
[DataGoogleDrive]
type = drive
client_id =
client_secret =
scope = drive
root_folder_id =
service_account_file =
token = {"access_token":"ya29.GluQBqUwE0EzCTYYzEcnu8U2OD0NVwM3IkZ6A2THCo4h6BFAL3PUlooiKz0iP1yrg37Jldf-L-H4Xq1HAle2T0EiOAvfDJO1CHdAe80C-y1bMFRhRdJ-KP3WV7P9","token_type":"Bearer","refresh_token":"1/HAiie9z3WFbBbfj0xwMSJRWdswHIDSEBcN0PtL7IGjI","expiry":"2019-08-15T21:08:30.116867446T"}
team_drive =
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d>
#Masukkan Y untuk simpan
y/e/d> y
#output
Name Type
==== ====
Datab2 b2
DataGoogleDrive drive
DataWebdavCloud webdav
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>
#masukkan q untuk keluar
e/n/d/r/c/s/q> q
#list direktori pada cloud, jangan lupa tanda titik dua (:)
rclone ls DataGoogleDrive:
#output
23441567 Jaringan.pptx
23418348 Fiber_optic.pptx
56418975 modul.pdf
Tags
linux