I have a partition that contains a mix of text files, which compress well, and PDF files, which are essentially already compressed. Would it be feasible to compress only certain file types? Or exclude certain file types from being compression again?
Of course, we know that file extension is not a 100% reliable way to determine if a file is already compressed or not, but it would be good enough in this case, I think.
Thanks.
The benefit of not trying to recompress files that are already compressed would be in CPU utilization on the host running the backup. If the file is already well compressed, those clock cycles are not helping much.
Yes, the added complexity of two parallel snapshot configurations is a significant downside. I was hoping it was conceptually simple enough to think about as a feature request. I’m not quite sure from the reply if the answer is addressing the feasibility in terms of architecture or the existence of configuration options. I should have been clearer in my question, as I already knew there was not an option for such a configuration.
What would maybe make sense is to implement early abort when data is not compressible - similar to one existing in ZFS.
But it would be quite serious undertaking and IMO brings very limited gains to backup software like restic. Especially given multiple much more important features waiting for implementation.
But let’s see what others think.
I’ve always thought using zstd frees you from having to think about this (at least at the default compression level), because zstd checks the file type before deciding compression level etc.
Is that not true?
zstd
is compression algorithm - it compress/decompress whatever you throw at it:)
I would be VERY surprised if restic zstd implementation (which probably is some 3rd party lib) does it. It would be VERY bad if it does based on file type.
Looks like I misremembered as well as confused a couple of things. First, borg does this, but it is borg doing it, not “using a zstd feature”. Having mis-remembered that, I then extrapolated it to any tool using zstd !