1.下载rclone安装包,复制多个.exe并重命名
2.1添加rclone1server.xml
<service>
<id>rclone1</id>
<name>rclone1</name>
<description>rclone1service</description>
<executable>rclone</executable>
<arguments>rcd --rc-addr=0.0.0.0:5556 --rc-user=root --rc-pass=123456</arguments>
</service>
2.2添加rclone2server.xml
<service>
<id>rclone2</id>
<name>rclone2</name>
<description>rclone2service</description>
<executable>rclone</executable>
<arguments>rcd --rc-addr=0.0.0.0:5557 --rc-user=root --rc-pass=123456</arguments>
</service>
2.2添加rclone3server.xml
<service>
<id>rclone3</id>
<name>rclone3</name>
<description>rclone3service</description>
<executable>rclone</executable>
<arguments>rcd --rc-addr=0.0.0.0:5558 --rc-user=root --rc-pass=123456</arguments>
</service>
3.配置环境变量
“我的电脑”–鼠标右键–“属性”–“高级系统设置”–“环境变量”–选择“Path”–“编辑”–“新建”–最后一行填入安装路径(“D:\tools\rclone”),最后全部确定保存。
4.注册为服务
打开D:\tools\rclone,鼠标在空白处右键,打开终端,重复打开3个终端,(或者使用win+x 然后a)
分别输入rclone1server.exe install和rclone1server.exe start;rclone2server.exe install和rclone2server.exe start;rclone3server.exe install和rclone3server.exe start;
注意:更新配置后如果配置未生效可重启一下服务再用
创建远端配置,在powershell中执行下面的命令
$headers = @{
‘Content-Type’ = ‘application/json’
‘Authorization’ = ‘Basic cm9vdDoxMjM0NTY=’
}
Invoke-WebRequest http://{rclone的ip}:5558/config/create -Method POST -Headers $headers -Body ‘{“name”:“minio”,“type”:“s3”,“parameters”:{
“provider”:“Minio”,
“access_key_id”:“minioadmin”,
“secret_access_key”:“minioadmin”,
“endpoint”:“http://ip:9000”
}}’
更新远端配置
$headers = @{
‘Content-Type’ = ‘application/json’
‘Authorization’ = ‘Basic cm9vdDoxMjM0NTY=’
}
Invoke-WebRequest http://{rclone的ip}:5558/config/update -Method POST -Headers $headers -Body ‘{“name”:“minio”,“type”:“s3”,“parameters”:{
“provider”:“Minio”,
“access_key_id”:“minioadmin”,
“secret_access_key”:“minioadmin”,
“endpoint”:“http://ip:9000”
}}’
删除远端配置
$headers = @{
‘Content-Type’ = ‘application/json’
‘Authorization’ = ‘Basic cm9vdDoxMjM0NTY=’
}
Invoke-WebRequest http://{rclone的ip}:5558/config/delete -Method POST -Headers $headers -Body ‘{“name”:“minio”}’