Backup repositories without compression

restic v 0.17.1

System Debian

Is it possible to backup in ONE snapshot some directories without compression?

I like to backup my NAS with restic with maximum compression but some directories are restic repostories so using compression is waste of time of CPU and backup time.
I prefer backup of every disks (2 HDDs) in one snapshot.

If you mean to back up a set of folders, of which only some you do not want to be compressed, then no, you cannot do that in one and the same backup run.

What you can do is back up the folders you want compression on in one backup run, and the other folders that you don’t want compression on in another backup run. The --compression option applies individually for each invocation of backup, so you can enable/disable it per backup run.

See Tuning Backup Parameters — restic 0.17.1 documentation for more information.

1 Like

Why use use restic to backup restic repositories? It would make more sense to just copy them (either a straight copy or use rsync). This would both be much faster and substantially less cpu intensive.

Expanding on what @rawtaz suggested, once I did something a little bit different to create an initial snapshot with a subdir that I didn’t bother to compress:

restic init
restic backup my-data/subdir --compression off

(takes note of the snapshot id, say abcd1234)

restic backup my-data/ --parent abcd1234
restic forget abcd1234

After that, I just left the compression on auto, which works for my use case.

1 Like

I need rewrite my backup scripts so I asked question about compression.