Option to clear the cache on unmount (or use an in-memory cache)

What is the problem you are having with rclone?

Looking for an option to automatically clear the cache on unmount or use in-memory cache only.

Run the command 'rclone version' and share the full output of the command.

rclone v1.65.1 on macOS arm64

Which cloud storage system are you using? (eg Google Drive)

Any

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone nfsmount --vfs-cache-mode=full remote: ~/local

Looking for an option to automatically clear the cache on unmount. This is not a space issue, but rather a privacy issue. I understand the cache is local to my computer, but still, if one uses it to copy sensitive files from the cloud to a local folder that is encrypted, the cache leaves the files exposed in the clear after the mount command ends. I'm OK with the files temporarily being in the cache, but they shouldn't be left in the cache until the next mount.

Of course, one could script this to rm the cache after the mount command, but it would be nice to just be able to pass a flag to rclone to just do it on exit, best effort. I also understand this may not be reliable, if rclone crashes, etc. it may not get a chance to clean up the cache and user intervention is still needed.

Or just use an in-memory cache which would be even better because it goes away when the process is gone. Of course there may be memory limits, but for users who have the RAM or deal with a few small files this should be fine.

Given that you do not trust your disk I think you reached the correct conclusion yourself.

Create RAM disk (you can even make it encrypted) and point rclone cache to it using --cache-dir flag.

Or just rm -rf ~/Library/Caches/rclone as part of a mount/unmount script (or wherever --cache-dir points for that instance of rclone).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.