Limited backup destination space?

Is there a way to be warned if the backup destination does not have enough space for the current backup?

My apologies if this is addressed in the documentation; I did not see it.



There’s no way to get an automated warning yet. This would be relevant for the local and sftp backends only: For the other ones we don’t have any way to find out how much space there’s still available.

It’s a bit tricky to find out if there would be enough space, restic can only really know that once it is through with reading all data… it can maybe make an educated guess, or warn you when space is about to run out, but that’s not implemented yet.

Fair enough. What happens if I run out of space in the middle of a backup, in the worst case?

Worst case regarding restic and the repository would be that the snapshot you wanted to make does not finish and the data you meant to backup in this very snapshot is not saved.

So will the snapshot:

  1. not exist at the end of the aborted run, or
  2. be created, but not be complete, so that only some files are in it and others aren’t as if they had never existed / been updated, or
  3. be internally inconsistent?

Based on my limited understanding of the documentation, it appears that it might be alternative #1, plus some “leftovers” that aren’t part of any snapshot but which can be pruned.

Does that sound right?

There is (soon) a way to do this, if you use the rest-server backend. Pending the merge of this PR, then this other PR will be ready to go. It allows you to limit the size of the repository you back up to.

When @fd0 has some time to approve the changes, I think we can make this happen.

Exactly, the snapshot won’t exist since it is only written at the very end, and there’ll be some additional data in the repo. Except for the prune and forget operations, a restic repo is append-only: restic will only ever create new files and never modify existing ones. So when the disc is full, you can rest assured that all previous snapshots still work and the data is still there.

1 Like

I added a bit of text to the documentation, so you guys don’t need to answer the same question from the next guy :slight_smile:

1 Like