ラベル rclone の投稿を表示しています。 すべての投稿を表示
ラベル rclone の投稿を表示しています。 すべての投稿を表示

2022年9月18日日曜日

Raspberry Pi OS(Raspbian Bullseye)にrcloneをインストールする

rcloneでクラウドストレージやストレージサーバ間でファイルを管理したり・同期する事ができます。

インストール方法

以下のコマンドでrcloneをインストールします。
sudo apt-get install curl

curl https://rclone.org/install.sh | sudo bash

リモート構成の登録方法

rclone configコマンドを使用して、Nextcloudをリモートストレージとして登録します。
rclone config

No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config

n/s/q> n ※新しいリモート構成を作成する
name> nextcloud ※任意のリモート構成の名称を入力

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
 1 / 1Fichier
   \ (fichier)
 2 / Akamai NetStorage
   \ (netstorage)
 3 / Alias for an existing remote
   \ (alias)
 4 / Amazon Drive
   \ (amazon cloud drive)
 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, Digital Ocean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi
   \ (s3)
 6 / Backblaze B2
   \ (b2)
 7 / Better checksums for other remotes
   \ (hasher)
 8 / Box
   \ (box)
 9 / Cache a remote
   \ (cache)
10 / Citrix Sharefile
   \ (sharefile)
11 / Combine several remotes into one
   \ (combine)
12 / Compress a remote
   \ (compress)
13 / Dropbox
   \ (dropbox)
14 / Encrypt/Decrypt a remote
   \ (crypt)
15 / Enterprise File Fabric
   \ (filefabric)
16 / FTP
   \ (ftp)
17 / Google Cloud Storage (this is not Google Drive)
   \ (google cloud storage)
18 / Google Drive
   \ (drive)
19 / Google Photos
   \ (google photos)
20 / HTTP
   \ (http)
21 / Hadoop distributed file system
   \ (hdfs)
22 / HiDrive
   \ (hidrive)
23 / Hubic
   \ (hubic)
24 / In memory object storage system.
   \ (memory)
25 / Internet Archive
   \ (internetarchive)
26 / Jottacloud
   \ (jottacloud)
27 / Koofr, Digi Storage and other Koofr-compatible storage providers
   \ (koofr)
28 / Local Disk
   \ (local)
29 / Mail.ru Cloud
   \ (mailru)
30 / Mega
   \ (mega)
31 / Microsoft Azure Blob Storage
   \ (azureblob)
32 / Microsoft OneDrive
   \ (onedrive)
33 / OpenDrive
   \ (opendrive)
34 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ (swift)
35 / Pcloud
   \ (pcloud)
36 / Put.io
   \ (putio)
37 / QingCloud Object Storage
   \ (qingstor)
38 / SSH/SFTP
   \ (sftp)
39 / Sia Decentralized Cloud
   \ (sia)
40 / Storj Decentralized Cloud Storage
   \ (storj)
41 / Sugarsync
   \ (sugarsync)
42 / Transparently chunk/split large files
   \ (chunker)
43 / Union merges the contents of several upstream fs
   \ (union)
44 / Uptobox
   \ (uptobox)
45 / WebDAV
   \ (webdav)
46 / Yandex Disk
   \ (yandex)
47 / Zoho
   \ (zoho)
48 / premiumize.me
   \ (premiumizeme)
49 / seafile
   \ (seafile)

Storage> 45 ※Nextcloudなどは45 Webdavを選択します
** See help for webdav backend at: https://rclone.org/webdav/ **

Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a value.
url> http://<ホスト名またはIP>:<ポート>/nextcloud/remote.php/dav/files/admin/ ※webルートにnextcloudがインストールされている場合はhttp://<ホスト名またはIP>:<ポート>/remote.php/dav/files/admin/になります。

Option vendor.
Name of the WebDAV site/service/software you are using.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
 1 / Nextcloud
   \ (nextcloud)
 2 / Owncloud
   \ (owncloud)
 3 / Sharepoint Online, authenticated by Microsoft account
   \ (sharepoint)
 4 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
   \ (sharepoint-ntlm)
 5 / Other site/service or software
   \ (other)

vendor> 1 ※Nextcloudの場合は1を入力します

Option user.
User name.
In case NTLM authentication is used, the username should be in the format 'Domain\User'.
Enter a value. Press Enter to leave empty.
user> admin ※ Nextcloudのユーザ名を入力します


Option pass.
Password.
Choose an alternative below. Press Enter for the default (n).
y) Yes, type in my own password
g) Generate random password
n) No, leave this optional password blank (default)
y/g/n> y ※ パスワードを入力するにはyを入力します

Enter the password:
password: ※パスワードを入力します
Confirm the password:
password: ※ パスワードを確認入力します

Option bearer_token.
Bearer token instead of user/pass (e.g. a Macaroon).
Enter a value. Press Enter to leave empty.
bearer_token> ※ 何も入力せずエンターキーを押します

Edit advanced config?
y) Yes
n) No (default)
y/n> ※ nを入力します


Configuration complete.
Options:
- type: webdav
- url: http://<ホスト名またはIP>:<ポート>/nextcloud/remote.php/dav/files/admin/
- vendor: nextcloud
- user: admin
- pass: *** ENCRYPTED ***
Keep this "nextcloud" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y ※ yで保存します

Current remotes:

Name                 Type
====                 ====
nextcloud            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> q ※抜ける場合はqを入力します

ローカルファイルの同期方法

以下のコマンドで、ローカルの~/testの内容をnextcloudのtestフォルダに同期します
rclone --verbose sync ~/test nextcloud:/test
※~/testに何もない状態だと、nextcloud側の/textは全て消されるので注意

2021年2月18日木曜日

Ubuntu 20.04にrcloneをインストールする

rcloneでクラウドストレージやストレージサーバ間でファイルを管理したり・同期する事ができます。

インストール方法

以下のコマンドでrcloneをインストールします。
sudo apt-get install curl

curl https://rclone.org/install.sh | sudo bash

リモート構成の登録方法

以下のコマンドを入力して、リモートのnextcloudを登録します。
rclone config

No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config

n/s/q> n ※新しいリモート構成を作成する
name> nextcloud ※任意のリモート構成の名称を入力
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> 34 ※Nextcloudなどは34 Webdavを選択します
** See help for webdav backend at: https://rclone.org/webdav/ **

URL of http host to connect to
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Connect to example.com
   \ "https://example.com"

url > http://xxxxx/nextcloud/remote.php/dav/files/admin/ ※NextcloudのWebDAV URLを入力します。
Name of the Webdav site/service/software you are using
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value

1 / Nextcloud
   \ "nextcloud"
2 / Owncloud
   \ "owncloud"
3 / Sharepoint
   \ "sharepoint"
4 / Other site/service or software
   \ "other"
vendor> 1 ※Nextcloudの場合は1を入力します
User name
Enter a string value. Press Enter for the default ("").
user> admin ※ Nextcloudのユーザ名を入力します
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank (default)
y/g/n> y
Enter the password:
password: ※パスワードを入力します
Confirm the password: ※ パスワードを確認入力します
password:
Bearer token instead of user/pass (eg a Macaroon)
Enter a string value. Press Enter for the default ("").
bearer_token>
Edit advanced config? (y/n)
y) Yes
n) No (default)
Command to run to get a bearer token
Enter a string value. Press Enter for the default ("").
bearer_token_command>
Remote config
--------------------
[nextcloud]
type = webdav
url = http://xxxxxx/nextcloud/remote.php/dav/files/admin/
vendor = nextcloud
user = admin
pass = *** ENCRYPTED ***
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
nextcloud            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> q ※抜ける場合はqを入力します

ローカルファイルの同期方法

以下のコマンドで、ローカルの~/testの内容をnextcloudのtestフォルダに同期します
rclone --verbose sync ~/test nextcloud:/test