Your Search Bar For Shrewd Tips

How Do I Clear Rclone Cache?


How Do I Clear Rclone Cache?

If Rclone is showing outdated files, using more disk space than expected, or serving an old directory listing, clearing its cache may help. The right method depends on which cache you mean. Rclone can cache file contents on disk when using a VFS mount, keep directory listings in memory, and use other caching arrangements. These are separate, so deleting the wrong folder may not solve the problem—and deleting files while a mount is still writing can cause data loss.

This guide explains how to identify the cache, clear it safely, and prevent it from growing too large. Before you remove anything, make sure you understand whether the cache could contain changes that have not yet been uploaded.

What Does the Rclone Cache Store?

People often use “Rclone cache” to describe several different things. The most common is the VFS file cache used by an Rclone mount. When enabled, it can store file data locally so applications can read, write, or seek through files more reliably. The cache may include downloaded content and files waiting to be uploaded.

A mount can also keep directory information in memory. This directory cache helps Rclone avoid repeatedly asking the remote storage service for folder listings. Clearing the VFS file cache does not necessarily clear these in-memory listings, and restarting the mount does not necessarily remove files stored on disk.

Some older setups use a remote named with the cache: backend. That is different from the VFS cache used by rclone mount. First identify which setup you have; the steps below focus mainly on VFS mounts, which are the usual reason people search for how to clear Rclone cache.

Before Clearing Rclone Cache

Check for pending writes before deleting cache files. With VFS write caching enabled, a changed file may remain on the local disk for a period before Rclone uploads it. Removing that file too early can discard the only copy of your changes. If you use a write-enabled mount, allow uploads to finish and shut the mount down cleanly.

  • Check whether the mount is still active and whether applications are using it.
  • Save and close files opened through the mount.
  • Wait for pending uploads to complete, especially if you use write-back behavior.
  • Note the mount’s cache settings, including any custom --cache-dir value.
  • Do not delete a general cache folder if other Rclone processes or applications use it.

If you are unsure whether files have finished uploading, do not clear the cache yet. Confirm the remote has the latest versions first, or make a separate copy of important local files before proceeding.

Find the Rclone Cache Directory

The cache location depends on your operating system and command-line options. If the mount was started with --cache-dir, that setting takes precedence. Look at the command, script, service file, or task that starts the mount to find it. If you did not set a custom location, ask Rclone to show its standard paths:

rclone config paths

The output includes Rclone’s cache path. A VFS mount may store its working data within that location or a related subdirectory, depending on the setup and Rclone version. Check the mount’s options and inspect the relevant directory before deleting anything. Do not assume that every file in the general Rclone cache directory belongs to one mount.

If Rclone runs as a background service, check which user runs it. A service may have a different home directory—and therefore a different default cache location—than the account you use in your terminal. On Windows, the service account may also differ from your normal Windows account.

Safely Clear the VFS Disk Cache

For a full reset of a VFS disk cache, stop the mount cleanly first. Use the normal unmount procedure for your operating system or stop the service or process that started Rclone. Avoid terminating Rclone abruptly if it may still be uploading files. Once the mount has stopped and pending writes are safe, remove only the cache directory used by that mount.

On Linux or macOS, the general pattern is:

rm -rf "/path/to/the/mount-cache"

Replace the example path with the exact directory you identified. The rm -rf command permanently removes the specified directory and its contents, so check the path carefully before running it. Do not copy the example literally, and do not point it at your home directory, your Rclone configuration folder, or a directory whose contents you have not verified.

On Windows, stop the mount and then delete the confirmed cache folder in File Explorer. You can also use PowerShell, replacing the example path with the correct one:

Remove-Item -LiteralPath "C:\path\to\the\mount-cache" -Recurse -Force

Again, verify the path before running the command. If several mounts share a cache directory, deleting it can affect all of them. Clearing the entire directory removes cached data, but it does not delete files from the remote cloud storage. On the next access, Rclone will rebuild the cache as needed, which may make the first reads slower.

Clear Rclone’s Directory Cache Instead

If the problem is an outdated folder listing rather than stale file contents, you may only need to refresh the directory cache. Restarting the mount clears its in-memory state. For a running mount with the remote control (RC) interface enabled, Rclone also provides a VFS command to forget directory listings:

rclone rc vfs/forget

This asks the running Rclone instance to forget its cached directory information. You can also request that a specific directory be forgotten by supplying its path, if supported by your setup:

rclone rc vfs/forget dir="path/to/directory"

The RC command must be able to reach the correct running Rclone instance. If remote control is not enabled or the command cannot connect, restart the mount instead. Forgetting a directory listing does not erase the VFS file cache on disk, so it will not reclaim disk space used by cached file contents.

You can also review the mount’s --dir-cache-time setting. This controls how long directory entries are kept before Rclone checks them again. A shorter value may make remote changes appear sooner, but it can increase requests to the storage provider.

Use Rclone’s Cache Limits to Avoid Repeated Cleanup

If the cache keeps growing, set limits on the mount rather than regularly deleting files by hand. The VFS options --vfs-cache-max-size and --vfs-cache-max-age control the maximum size and age of eligible cached data. For example, a mount might include options like these:

--vfs-cache-mode full
--vfs-cache-max-size 10G
--vfs-cache-max-age 24h

These values are examples, not universal recommendations. Choose limits that suit your free disk space, file sizes, and workload. Rclone applies cache management over time; setting a limit is not the same as immediately deleting every cached file. Files that are active or otherwise needed may not be removable until they are no longer in use.

The VFS cache mode also affects how Rclone handles files. For instance, --vfs-cache-mode writes caches writes, while full also supports local caching for reads and seeking. Disabling VFS caching may not be suitable for applications that expect normal local-file behavior. Review the mount’s needs before changing its mode.

What If You Use the Legacy Cache Backend?

If your configuration uses a remote with a name such as cache:, do not assume it is the same as a VFS mount cache. The older cache backend works differently and may store data on another configured remote. Check the remote’s configuration and identify where its cached objects live before removing anything.

Be cautious with commands such as rclone purge. They remove objects from the remote path you specify; they are not a universal “clear local cache” command. Using one against the wrong remote or path could delete actual cloud files. If you are unsure how an old cache remote is configured, back up the configuration and consult the relevant Rclone documentation before attempting cleanup.

Why Is Rclone Cache Still Using Disk Space?

After cleanup, confirm that you removed the active mount’s cache rather than a different Rclone directory. Check for another running mount, a service using a different account, or a custom --cache-dir option. Also remember that accessing files again causes Rclone to rebuild cache data, so some disk use after a reset is expected.

If the cache does not shrink as quickly as expected, the mount may still be active or files may be in use. Check the process and mount options, then review the configured maximum size and age. Avoid repeatedly deleting folders while Rclone is running; that can interrupt file operations without addressing the underlying configuration.

Conclusion

To clear Rclone cache safely, first identify whether you mean VFS file data, directory listings, or a legacy cache remote. For a VFS disk-cache reset, confirm the correct cache path, wait for pending writes, stop the mount cleanly, and remove only that mount’s cache directory. For outdated folder listings, restart the mount or use rclone rc vfs/forget when remote control is available.

Set suitable VFS cache limits if disk usage is a recurring issue, and always verify your paths before deleting files. With the cache type and active mount identified, clearing Rclone cache becomes a straightforward maintenance task rather than a risk to your data.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →