Refresh/Clear an item/directory from the cache

What’s the best way to clear a single item from the cache?

I can see an issue with something like:

Mar 27 16:21:49 gemini rclone[20638]: smu5ej34ujbdoip1cm3mlk92q4/61aitk3dc8289libd64fml2j1e7ff28r1kaoea517akip6h0t8qg/lal8gdvdl267lvqia6vt27ot0k8phu0ukp1ff2i37gvi4mgae0rhrfli66p1efs7hqpq8m3m2hdoa: error refreshing object in : in cache fs Google drive root 'media': object not found

That was when I was uploading some items via a rclone upload to a different spot and I’ve since moved to the tmp_upload method and just caching the writes.

I had a few items that I need to expire but didn’t want to nuke my whole cache. I started with the --rc but couldn’t find any docs on how to actually use it.

I think I finally got it figured out:

rclone rc cache/expire remote=smu5ej34ujbdoip1cm3mlk92q4/61aitk3dc8289libd64fml2j1e7ff28r1kaoea517akip6h0t8qg

as I found the docs in the github for some more details.

@remus.bunduc - Is there a reason you can’t go GD->DECRYPT->CACHE? It would make the decrypted file names appear which would make life much easier in trying to track stuff back and figure out where the issues are. I saw there have been a lot of posts in terms of making sure it was GD->CACHE->DECRYPT

actually you can use the decrypted filename like rclone rc cache/expire remote=relative/path/to/item

it will detect if it is wrapped by a crypt remote and automatically encrypt the filename to expire the item in the cache.

cache wrapping a crypt is not optimized atm and will likely get you a 24h ban pretty quick

How would you know what the decrypted name is if you only see the encrypted name in the log?

I did finally figure out the proper way to do it. I kept trying expire an item that wasn’t in the cache. I tried using vfs/forget to remove the item and it kept coming back.

Finally, I just expire the directory that the shows were in and that worked.

[felix@gemini Designated Survivor]$ rclone rc cache/expire remote="TV/Designated Survivor"
	"message": "cached directory cleared: smu5ej34ujbdoip1cm3mlk92q4/61aitk3dc8289libd64fml2j1e7ff28r1kaoea517akip6h0t8qg",
	"status": "ok"

My errors:
[felix@gemini Designated Survivor]$ mediainfo Designated.Survivor.S02E11.HDTV-720p.mkv
E: File read error

When I ran my plex analyze, I saw what files were stuck being analyzed and that helped me fix it. Much better than rebuilding the whole cache so the rc commands are very useful!

For anyone reading, cache/expire takes encrypted or decrypted path names happily.

That being said, as with you I too have log entries like that, often looping repeatedly for ages as an application tries to find something missing. It would be nice if that log message triggered a cache purge of that file/parent directory if needed until the error stopped?