rclone v1.56.2 で Nextcloud を利用する方法 -その1

この記事は公開されてから時間が経っています

Nextcloud に格納されているファイルの正当性を確認したいと思い REST API の PROPFIND に checksums と言う項目があるのをみつけたが、404 Not Found が帰ってきてしまう
そこで、調べてみたら rclone と言うツールでファイルを格納するとチェックサムが格納されという事だったので試してみた備忘録


 
rclone は、クラウドストレージなどで利用する rsync の様な使い方のできるとのことです
rclone では、WebDAV を操作することが出来る様で、その一環で ownCloud と Nextcloud を利用できるようです
 
リモートシステムの設定に名前を付けて記録し、その名前をショートカットやドライブ名の様に設定して利用します
 
例えば、このサーバーの Nextcloud にbbz というリモート名をつけたとすると
rclone ls bbz:Images
って言う感じです
 
Windows で使うには、開発元のサイトから 32bit/64bit の環境に合わせて .zip ファイルをダウンロードして解凍するだけです
 
設定はこんな感じです
rclone config
2021/10/04 15:27:23 NOTICE: Config file "C:\\Users\\user\\AppData\\Roaming\\rclone\\rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> bbz
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 Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, SeaweedFS, and Tencent COS
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Compress a remote
\ "compress"
10 / Dropbox
\ "dropbox"
11 / Encrypt/Decrypt a remote
\ "crypt"
12 / Enterprise File Fabric
\ "filefabric"
13 / FTP Connection
\ "ftp"
14 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
15 / Google Drive
\ "drive"
16 / Google Photos
\ "google photos"
17 / Hadoop distributed file system
\ "hdfs"
18 / Hubic
\ "hubic"
19 / In memory object storage system.
\ "memory"
20 / Jottacloud
\ "jottacloud"
21 / Koofr
\ "koofr"
22 / Local Disk
\ "local"
23 / Mail.ru Cloud
\ "mailru"
24 / Mega
\ "mega"
25 / Microsoft Azure Blob Storage
\ "azureblob"
26 / Microsoft OneDrive
\ "onedrive"
27 / OpenDrive
\ "opendrive"
28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
29 / Pcloud
\ "pcloud"
30 / Put.io
\ "putio"
31 / QingCloud Object Storage
\ "qingstor"
32 / SSH/SFTP Connection
\ "sftp"
33 / Sugarsync
\ "sugarsync"
34 / Tardigrade Decentralized Cloud Storage
\ "tardigrade"
35 / Transparently chunk/split large files
\ "chunker"
36 / Union merges the contents of several upstream fs
\ "union"
37 / Uptobox
\ "uptobox"
38 / Webdav
\ "webdav"
39 / Yandex Disk
\ "yandex"
40 / Zoho
\ "zoho"
41 / http Connection
\ "http"
42 / premiumize.me
\ "premiumizeme"
43 / seafile
\ "seafile"
Storage> 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> https://bbz.jp/XXXXXXXX/remote.php/dav/files/XXXXXXXX/
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 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
User name. In case NTLM authentication is used, the username should be in the format 'Domain\User'.
Enter a string value. Press Enter for the default ("").
user> XXXXXXXX
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 (e.g. a Macaroon)
Enter a string value. Press Enter for the default ("").
bearer_token>
Edit advanced config?
y) Yes
n) No (default)
y/n> n
--------------------
[bbz]
type = webdav
url = https://bbz.jp/XXXXXXXX/remote.php/dav/files/XXXXXXXX/
vendor = nextcloud
user = XXXXXXXX
pass = *** ENCRYPTED ***
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
 
Name Type
==== ====
bbz 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
 
C:\Users\user\Downloads\rclone-v1.56.2-windows-amd64>rclone ls bbz
2021/10/04 15:37:44 ERROR : : error listing: directory not found
2021/10/04 15:37:44 Failed to ls with 2 errors: last error was: directory not found
 
C:\Users\user\Downloads\rclone-v1.56.2-windows-amd64>rclone ls bbz:

 
表示が一杯在るので面倒臭そうに見えますが、選択肢の一覧をカラフルに表示してくれているだけなので、ちょっと鬱陶しいだけです
 
手順は、リモート名を決めて、WebDAV で Nextcloud を使うと選択して、認証情報を指定するだけです
URL は、Nextcloud の歯車アイコンで表示する URL ですね…
 
先頭の方にもありますが、
¥AppData¥Roaming の下に設定ファイルを保存します
パスワードなどは暗号化さています
 
一回、リモート名を設定すると、次回からリモート名が表示され、修正や削除などが出来る様になります
 
つづく

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です


The reCAPTCHA verification period has expired. Please reload the page.