rclone配置同步WebDAV

为了方便家里NAS和服务之间的文件同步,开启了nas的WebDAB功能,通过rclone这个工具,可以方便同步文件。

一、rclone配置

  1. 新建配置

    这里新建一个名为nas的webdav配置

rclone config
2023/12/13 19:43:21 NOTICE: Config file "/home/hotpod/.config/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

Enter name for new remote.
name> nas
  1. 选择WebDAV存储

    rclone在不断更新,不同版本中webdav所处的序号不同,我这里是第52个

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, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
   \ (s3)
51 / Uptobox
   \ (uptobox)
52 / WebDAV
   \ (webdav)
53 / Yandex Disk
   \ (yandex)
54 / Zoho
   \ (zoho)
55 / premiumize.me
   \ (premiumizeme)
56 / seafile
   \ (seafile)
Storage> 52
  1. 配置webdav的url

    vendor选择6,即普通的webdav验证方式即可 群辉下webdav默认的端口号是5005,我这里改成了8005

Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a value.
url> http://bytetoy.cn:8005

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 / Fastmail Files
   \ (fastmail)
 2 / Nextcloud
   \ (nextcloud)
 3 / Owncloud
   \ (owncloud)
 4 / Sharepoint Online, authenticated by Microsoft account
   \ (sharepoint)
 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
   \ (sharepoint-ntlm)
 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
   \ (rclone)
 7 / Other site/service or software
   \ (other)
vendor> 6
  1. 配置登录帐号

    即nas中的帐号,群辉默认使用是平时登录的帐号 至于token和高级功能可以暂时不配置

Option user.
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 (master).
user> admin

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, keep existing (default)
y/g/n> 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>
  1. 配置完毕

    配置完毕后,即可显示已经配置的信息。

Configuration complete.
Options:
- type: webdav
- url: http://bytetoy.cn:8005
- vendor: rclone
- user: admin
- pass: *** ENCRYPTED ***
Keep this "nas" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Current remotes:

Name                 Type
====                 ====
nas                  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

二、rclone使用

  1. 列表webdav的全部文件

    使用刚才名为nas的webdav,即可使用rclone ls nas:/列表全部文件

rclone ls nas:/
2764211696 classic/2023.HD1080P.英语中字.mp4
2752978740 classic/4K.mp4
   166751 classic/Guy.Ritchies.The.Covenant.2023.1080p.AMZN.WEB-DL.DDP5.1.H.264-CM.chs&eng.ass
6673521252 classic/Guy.Ritchies.The.Covenant.2023.1080p.AMZN.WEB-DL.DDP5.1.H.264-Q66.mkv
1976323059 classic/The.Equalizer.2.2018.HD1080P.中英双字.mp4
5985707165 classic/The.Equalizer.2014.BD1080P.X264.AAC.mp4
2254956961 classic/the.equalizer.3.2023.1080p.mp4
5703298583 classic/备份4.mp4
8954839040 classic/行骗高手 (2023) - Sharper.2023.1080p.WEB-DL.DDP5.1.H.264-CUPCAKES.mkv
1444845174 classic/过年.mp4
4184292789 classic/飞机陷落.中英双字.Plane.2023.HD1080P.X265.AAC-YYDS.mp4
3942645760 download/debian-11.7.0-amd64-DVD-1.iso
  1. 显示目录

    ls是显示全部文件,一般nas中存储的文件以万计,即可使用lsd仅显示目录,配合grep还可以进行过滤

rclone lsd nas:/music | grep 200
          -1 2023-10-05 22:03:32        -1 Beyond - 2002 Best Collection
          -1 2023-05-05 11:58:49        -1 华语经典热歌榜200首
  1. 下载文件

    rclone copy 源文件 目标位置

rclone copy nas:/music/华语经典热歌榜200首 ~/media/

results matching ""

    No results matching ""

    results matching ""

      No results matching ""