centos安装rclone挂载alist

一、安装alist

1.通过docker启动alist

bash 复制代码
docker run -d --restart=always \
  -v /usr/local/docker/alist/data:/opt/alist/data \
  -p 5244:5244 \
  -e PUID=$(id -u) \
  -e PGID=$(id -g) \
  -e UMASK=022 \
  --name alist \
  xhofe/alist:latest

2.访问alist

使用docker logs alist在容器日志中找到密码,访问http://IP:5244,登陆后可以修改密码

二、安装rclone

1.这里推荐在线安装,如果提示未安装unzip则安装重试

bash 复制代码
curl https://rclone.org/install.sh | sudo bash

2.验证,出现版本号即可

bash 复制代码
rclone --version

3.配置rclone通过webdav挂载alist

bash 复制代码
rclone config

这里会有11步交互的配置操作,我简单写一下每一步:

复制代码
1.是否选择新远程,选n
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
2.设置名字
name> rclone-alist
3.选择协议类型,这里我省略选项,输入webdav或输入前面的数字,我这是52
Type of storage to configure.
Choose a number from below, or type in your own value
//...
Storage> 52
4.输入webdav链接地址,即alist的webdav地址
Option url.
//...
url> http://127.0.0.1:5244/dav
5.选择webdav服务提供者的名字,选带Other的字段,我这是7
Name of the WebDAV site/service/software you are using
Choose a number from below, or type in your own value
//...
vendor> 7
6.输入webdav链接账号
Option user.
//...
user> admin
7.输入webdav连接密码,先选y,再输入两次密码
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank
y/g/n> y
Enter the password: 
password:
Confirm the password: 
password:
8.不输入Bearer token,直接回车
Bearer token instead of user/pass (e.g. a Macaroon)
bearer_token>
9.是否编辑高级配置,默认是n直接回车
Edit advanced config?
y) Yes
n) No (default)
y/n> 
10.配置完成,是否保持当前远程?默认y直接回车
//...
Keep this "rclone-alist" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
11.至此显示出当前远程仓库,选q退出当前配置模式
Current remotes:
Name                 Type
====                 ====
rclone-alist         webdav
//...
e/n/d/r/c/s/q> q

如果要修改配置,该文件在路径:/root/.config/rclone/rclone.conf

4.查看是否挂载成功

1.执行命令,成功则会显示alist中的目录

bash 复制代码
rclone lsd rclone-alist:/

5.安装fuse

1.fuse用于将rclone挂载的目录挂载到本地磁盘,在高版本rclone中需要安装fuse3

bash 复制代码
yum -y install fuse3

三、挂载到本地磁盘

1.根目录新建用于挂载到目录

bash 复制代码
mkdir /rclone_root

2.执行命挂载到新建的目录(可以将该命令设为开机启动执行即自动挂载)

bash 复制代码
rclone mount rclone-alist: /rclone_root --copy-links --allow-other --allow-non-empty --umask 000 --daemon

执行成功后会返回rclone挂载的pid,此时rclone_root 目录下就能看到挂载的alist目录

3.取消挂载

bash 复制代码
fusermount -qzu /rclone_root
相关推荐
岚天start5 小时前
Nginx配置中location和proxy_pass指令尾部是否带斜杠的区别
运维·nginx·centos·proxy_pass·location·uri·斜杠
gihigo19986 小时前
在CentOS上配置SVN至Web目录的自动同步
前端·svn·centos
纳切威6 小时前
CentOS 10服务器版 部署Zabbix7.2 server端
linux·运维·centos·zabbix
祐言QAQ6 小时前
(超详细,于25年更新版) VMware 虚拟机安装以及Linux系统—CentOS 7 部署教程
linux·运维·服务器·c语言·物联网·计算机网络·centos
心灵宝贝6 小时前
如何在CentOS 7上安装bzip2-1.0.6-13.el7.x86_64.rpm RPM包(详细步骤)
linux·服务器·centos
Java 码农6 小时前
CentOS 7 安装并配置静态网络
centos
瑶总迷弟6 小时前
静默安装 Oracle Database 21c on CentOS 7.6
数据库·oracle·centos
某zhuan18 小时前
云计算实验2——CentOS中zookeeper的安装
zookeeper·centos·云计算
做运维的阿瑞1 天前
Linux 企业级备份体系实战:cron/anacron/restic/rclone 对比与脚本总结
linux·运维·服务器·后端·学习·系统架构·centos
JeffreyGu.1 天前
centos网卡设置问题
linux·运维·centos