Using restic for daily backups of .tar files

Hello everyone,

I just started using restic, and I’m a bit confused about certain things I hope you can help me with.
My situation is as follows:

I have B2 storage over at backblaze, connected to restic with S3. (As per recommended by restic). I make daily backups of my appdata directory. This directory contains all my docker app data. The script I use for this (https://github.com/Drazzilb08/userScripts/tree/master/bash-scripts) is really neat for my situation as it stops the containers, making sure I get a proper backup of my databases. By default it compresses the backups per container to .tar.7z, and without just .tar.

What I want to know if it’s possible with restic to reduce the files backed up to my repo, by making use of deduplication. Asking, because I can’t think of a way it (referring to restic) can look further than then .tar. the files are stored per day in their own folder. (2023-08-28 ;etc.).

What can I do to make this backup process as efficient as possible, also making sure restoring a backup is easy and my data is ‘scrambled’ everywhere. I mention this as I’m, not familiar with if a file doesn’t change for 10 days, how it would restore it.

The backup script I use is more of convenience, if there are better ways to execute this, let me know. There is also a provided ‘exclude’ .txt file. Stopping the containers is what I deem essential, unless it isn’t and I’m seeing problems that aren’t there.

I hope you understand my situation and are able to help me out, as I pay per what I use and reducing helps me save money in the long run.

I was recommended restic by a friend, who seemed to be really fond of it, thanks! :slight_smile:

PS: I also make use of the plex script, and specific folder script in that same repo.

Hi! Tar has a “rsyncable” flag you should use to improve the possibility that restic can deduplicate content between backups.

Hi Martin,

Thanks for your reply! Where would I find this and how can I apply this to my use case?

Thanks!

I haven’t looked at your scripts, but I assume that you use the “tar” program to produce the tar files. That program has the option “—rsyncable” (preceding double dash).

Hi Martin,

I looked in to what you’re referring to here, I’ll do some tests on the script and see if I can make this work with the option you provided.

What are you recommendations when it comes to having a retention of 30 days for my backups (or longer), and them being removed after that time frame? I was thinking of the following:

restic -r s3:${endpoint}/${bucket}/appdata forget --keep-younger-than 30d
restic -r s3:${endpoint}/${bucket}/appdata prune

Let me know!

Thanks in advance! :slight_smile:

Sorry, that is entirely up to you.

As Martin has stated, it is up to you. I would pose the question: how long after you delete a file (accidentally or intentionally) before you might discover the need to retrieve it? That is your answer.