Why does a restore contains full backup?

Dear all,

I just registered with this forum here because I’m a new user of restic tools. As far as i can see it’s a great tool and our first experiences we made the last couple of weeks are promising.

I have a first question, perhaps someone can answer this because I can’t find answers for it in the documentation. I’m no native speaker of the english language, so I hope I can describe my issue in a way that everybody understands me. If not, please feel free to answer any question:

I’m doing daily backups to a S3 bucket with `restic". I have a lot of virtual machines to backup (about 1,500 at the moment) and for performance reasons I created several restic repositories because the S3 (and restic!) is somewhat unresponsive if you have to many concurrent requests against one single repository. Our restic repositories contain about 5-20 hosts, each of it containing 10 daily snapshots per host.

I’m cleaning my restic repositories with a policy “–keep-daily 10”. I started with my backups abount 20 days ago, so on day 1 of the backups a full backup has been done like this:

restic backup \
   --verbose \
   --host ${host} \
   --tag ${TENANT} ${BACKUP_DIR} 2>&1 >> $logFile

All other 19 days the same command was used for the backups which shall be, in my opinion, only incremental backups.

As an example I run on day 15 the following cleaning command:

restic forget \
   --host ${host} \
   --prune \
   --keep-daily 10

This commands removes the “oldest” backup from day 1 I have which was a full, initial backup.

My question is now:
How is assured that I get a complete restore of a snapshot when it’s missing the first full backup from the beginning 20 days ago as this full backup from 20 days ago does no exist anymore due to the purging policy.

Thanks in advance, any help is appreciated!
Joachim.

Snapshots are pictures of the filesystems at the time of the backup. The data is not stored in them. Data is only removed after all snapshots referring to it have been forgotten and a purge is performed.

There is a general misunderstanding of the term ‘snapshot’. restic snapshots are more similar to btrfs/snapper snapshots than snapshots referred to with other software.

3 Likes

Great answer by @doscott :slight_smile: Just to rephrase it a bit further, if you look at a piece of data (e.g. a part of a file), then this piece of data can be (and usually is) referenced by several snapshots. So if you back up a file in your first snapshot, and then take additional snapshots still including that same file, then even if the first snapshot is removed the other snapshots will still reference this file (and piece of data), and it will therefore be kept. You are all good.

2 Likes

Thanks go to @doscott and @rawtaz for the explanations, understood it now. Perhaps it could be a good idea to talk about this in more detail in the documentation?

Thanks again and have a nice day, wherever you are!
Joachim.