Skip to content

check should create cache directory if it doesn't exist instead of reporting an error #4437

@teran

Description

@teran

Output of restic version

It was 0.15.2, just checked on 0.16.0 - the same:

restic 0.16.0 compiled with go1.20.6 on darwin/amd64

How did you run restic exactly?

TMPDIR=/Volumes/Flash/Temp/restic restic --repo repoPath  --password-command 'someCommand' --cache-dir /Volumes/Flash/Temp/Cache/restic/repo check

not critical error received:

unable to create temporary directory for cache during check, disabling cache: stat /Volumes/Flash/Temp/Cache/restic/repo: no such file or directory

What backend/server/service did you use to store the repository?

local

Expected behavior

cache directory will be created and will be used just like in other subcommands

Actual behavior

according to error message: cache is disabled, cache directory is not created

Steps to reproduce the behavior

Run check on any repository with not existent but explicitly specified cache directory via flag

Do you have any idea what may have caused this?

haven't checked the source code in that place but it looks like different subcommands have different handling for the same flags

Do you have an idea how to solve the issue?

If the guess above is right: just isolate flag handling and reuse it

Did restic help you today? Did it make you happy in any way?

Sure, it works great and the issue is not critical at all :)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions