介紹
Rclone:是一款的命令行工具,支持在不同對象存儲、網盤間同步、上傳、下載數據。官網網址:rclone.org
WinFsp:是一款Windows平台下的文件系統代理軟件(Windows File System Proxy)。類似FUSE (Filesystem in Userspace)。官網網址: secfs.net/winfsp
使用
1、下載WinFsp,如我下載的是winfsp-1.4.19016.msi,下一步下一步安裝就行。
2、解壓rclone,運行:
rclone.exe config
我配置的是FTP,按步驟填IP賬號密碼,最后Quit config就行。
3、運行類似如下指令掛載:
rclone.exe mount PC2:/ X: --cache-dir D:\logs_rcloneCache --vfs-cache-mode writes
其中PC2是上一步rclone配置的名字,X:是掛載的本地磁盤位置,注意不要在最后加上/,D:\logs_rcloneCache是緩存的位置,默認會在C:\Users\用戶名\AppData\Local\rclone這里,后面的writes是緩存模式。效果如下:
也可以掛載為目錄:
rclone.exe mount PC2:/ C:\intel\2 --cache-dir D:\logs_rcloneCache --vfs-cache-mode writes
之后就可以當正常盤使用啦。幾種緩存模式可參考官方文檔,R醬的博文有中文說明,他舉例的是掛載網盤,也可以嘗試。
R醬還提到一種開機自動掛載的方式,參考腳本如下:
Option Explicit
Dim WMIService, Process, Processes, Flag, WS
Set WMIService = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
Set Processes = WMIService.ExecQuery("select * from win32_process")
Flag = true
for each Process in Processes
if strcomp(Process.name, "rclone.exe") = 0 then
Flag = false
exit for
end if
next
Set WMIService = nothing
if Flag then
Set WS = Wscript.CreateObject("Wscript.Shell")
WS.Run "rclone.exe mount PC2:/ C:\intel\1 --cache-dir D:\logs\_rcloneCache --vfs-cache-mode writes", 0
end If