--cleanup-cache seems to be ignored

Getting: “found 1 old cache directories in /home/lance/.cache/restic, pass --cleanup-cache to remove them”
I’ve tried several variations of the command, but restic seems to be completely ignoring the flag:

I’ve tried:
restic cache --cleanup-cache --verbose
restic cache --cleanup
restic check --cleanup-cache
restic backup ~ --exclude-file="/home/lance/restic/excludes.txt" --cleanup-cache

It always seems to run the command, but never the --cleanup-cache flag

Using Fedora 28, Restic 0.9.3

Any idea what’s going on here?

Thanks
Lance

Hi Lance,

Not sure, but I normally put the global flags before the command, did you try this?

restic --cleanup-cache backup ...

Cheers!

I don’t think when you run --cleanup-cache with another command displays anything. It doesn’t display any messages unless there was indeed old cache and it removes it. When you use restic cache --cleanup it supposed to display a message saying how many old caches removed or no old cache dirs found. Also, you may be having this problem because user’s permissions. If you’re using restic with the root account, for example, using your regular user to remove old cache would not work because the cache must be stored in /root/.cache/restic and a regular user does not have access to the root directory. I mention this because this was my case in the past. A little silly on my part but, yeah.

You could also delete the cache directory and let restic re-create it again. I was also using this version and just so you know, you can update to the newest version 0.9.4 if you want.

Hmmm, I tried just
restic --cleanup-cache
by itself, it looked through all the files, but still didn’t actually clean anything–as I’m still seeing the “found 1 old cache directories in /home/lance/.cache/restic, pass --cleanup-cache to remove them” message. Since I’m running it as user, the cache is in the user area, so it shouldn’t be a root permission error.

Anyone???

AFAIK, restic --cleanup-cache doesn’t do anything. It’s meant to be run in conjunction with other commands. Did you actually try to run restic cache --cleanup as @Dj0k3 suggested?

Hey, great!

did work after a restart (not sure why my machine wasn’t taking it before a restart).

So, apparantly the prompt is incorrect: It says “found 1 old cache directories in /home/username/.cache/restic, pass --cleanup-cache to remove them”
It should say run: restic cache --cleanup to remove them.

Thanks everyone!!!