Permission denied on index

I just realized that I get this error while checking a backup on a local USB

 create exclusive lock for repository
load indexes
Load(<index/9996ab444e>, 0, 0) returned error, retrying after 621.160164ms: open /media/…/USB-Backup/backup/index/9996ab444eb0b8b912158d5d428a79d4efc54051025c57f5771427fec8d0e98f: permission denied

Any idea why this happens and/or how to fix it. I’m running cron jobs and anacron

The user you’re currently running restic as does not have permission to read the file on the USB stick… You need to correct that.

Can you paste the output of id and ls -al /media/[...]/USB-Backup/backup/index?

is it possible that anacron (which runs as root) caused this issue. the regular cronjob runs with another user.

here is can see the culprit

drwx------ 2 lux lux   4096 Mär  3 13:30 .
drwx------ 7 lux lux   4096 Aug 27  2017 ..
-rw------- 1 root   root   978202 Mär  3 12:11 9996ab444eb0b8b912158d5d428a79d4efc54051025c57f5771427fec8d0e98f
-rw------- 1 lux lux 978269 Mär  3 13:30 f0ac87482b45411bde5b86a5777ce9aa03fe6893169345800bbb18527c3dd33f

Can I just delete this index?

Yes, you could, but then it’d be good to run restic rebuild-index once. But running chown lux:lux on the file is much better.

I did that, the index seems to be gone but I now get - when restic check - a

Load(<snapshot/0dea8998ed>, 0, 0) returned error, retrying after 586.272073ms: open /media/lux/USB-Backup/backup/snapshots/0dea8998edfee490626b8b4ade4d4229ed7d6efdf6c444fa841369ad3726493d: permission denied

I wonder if anacron creates the troubles