Can I use different compression levels in the same backup?

I am amazed by the new compression feature. I upgraded my repo to v2 and then ran prune --repack-uncompressed. However, I now have decided I would like to try maximum compression. Is there a way to do the repacking again on the already compressed data? Or can I at least use maximum compression on my new backups so that any new/changed data will get max compressed?

Changing the compression level of data that is already in the repository is not supported. However, you can set the maximum compression level when creating a new backup and that will compress all new data with the maximum compression level.

If you want to change the compression level of the entire repository, you could give the copy command a try:

restic -r /srv/restic-repo-copy init --from-repo /srv/restic-repo --copy-chunker-params
restic -r /srv/restic-repo-copy copy --from-repo /srv/restic-repo --compression max
1 Like

Thank you! But if I understand you correctly I can set compression to max for future snapshots in the same repository and newly written data will be compressed at the maximum level?

Not quite: for each run of restic backup or restic prune you can set the compression level for newly uploaded data via --compression (or $RESTIC_COMPRESSION), but there’s no global setting stored in the repo or so.

Is that clearer?

Yes, this is exactly what I meant, I am sorry if what I said was unclear. Thanks for the great work you two, my home directory which is 150GB uncompressed now is only 100GB even with the auto setting! This will save me a third of my cloud storage costs and it’s a really great deal for people who store even more than me. What’s the best way to donate to restic?

2 Likes

Same question here. How to donate $ to the project?

Thanks