Is restoring with `--no-lock` safe?

I’ve taken backup in a minio/s3 backend. To restore from that backend, I’ve created a role/user with read only access. Thus I need to execute restic restore command with --no-lock flag. In this case I’m not sure if it is safe to use --no-lock flag or not?

As long as you don’t at the same time run any other process that modifies the repository, it is totally fine.

@rawtaz Will it be just a restore failure if a process running at the same time modifies the repository? I mean there is no chance that the repository will be damaged for such failure, right?

It is actually totally fine unless you run prune at the same time.

1 Like

You are right in thinking that restore just reads data from the repository, and that if you were to modify the repository at the same time as a restore, that won’t damage the repository, it’s just a matter of restore potentially not getting back whatit expected when it reads the repository data (since that data might have changed).

What @alexweiss wrote is a more specific and correct - it’s totally fine to backup to the repository at the same time that you restore, it’s when you run something like prune that modifies the existing contents of the repository that you might/most likely will see problems due to modifying something at the same time as that something is being read/used.

1 Like