Add a folder to an existing backup


I’m moving my duplicity backups to restic after the latest Chaosradio episode because encryption is easier, reducing the looming fear of having to restore a backup. Thanks for your hard work!

For duplicity, I had separate jobs for a few folders, backing up into separate Backblaze B2 buckets.

With restic, I combined all of the folders into one repository/bucket for scripting convenience. The first snapshot of ~350 GB finished with this restic incantation:
restic -q --json /mnt/disk1 /mnt/disk2

Now that I got the backup working I wanted to add /etc:
restic -q --json /etc /mnt/disk1 /mnt/disk2

However, restic apparently wants to upload everything anew if I do that. It starts processing lots of music files from the storage disks and percent_completed increases veery slowly.

Undoing the change and running restic again will finish as quickly as I expected. It just uploads a few changed files.

Am I doing it wrong? Is there a better way to add folders to the backup?

It sounds like you might want to check out the --parent <snapshot> parameter.

Because you are changing the folders in the snapshot, restic is unable to detect the parent snapshot automatically. The --parent parameter lets you specify the parent explicitly (just use restic snapshots to find the id of the correct snapshot. This allows restic to skip reading the full contents of the files and should result in a faster backup.

Note, however, that even without specifying a parent snapshot, restic would not upload unchanged files again, because the deduplication algorithm would detect that they are already present in the repo (but only after reading the file and calculating the chunks, which does take a good amount of time, even if it is not uploading them).


Thanks for the tip, that worked just fine! Restic seems to be capable of a lot more tricks I need to read up on… :slight_smile:

1 Like