flomp
June 9, 2021, 9:02pm
1
I can’t find any documentation, how to specify the values for --add-never-compress
: is it .mp4
, mp4
or *.mp4
and is it case insensitive?
I looked at the relevant source code:
it is not a glob pattern, it is matched against the result of path/filePath.Ext()
, which takes the extension from the current file. The string must include the dot: .mp4
the match is case sensitive.
1 Like
Cal
January 1, 2023, 2:15pm
3
Is it comma or whitespace seperated?
A full example would be helpfull e.g. --add-never-compress=.mp4 .MP4 .7z .7Z
or --add-never-compress=".mp4 .MP4 .7z .7Z"
A list of extension can be found here
2 Likes
I was just testing this and the only thing I could make work was to add a separate flag for each instance eg.
--add-never-compress=.mp4 --add-never-compress=.7z
or to save some effort:
--add-never-compress=.[mM][pP]4 --add-never-compress=.7[zZ]
if you do --add-never-compress=.aac,.mp3
it’ll literally enter “.aac,.mp3”
Would love to learn of a better option! I have way too many for this dediousness so I use the UI to enter it for the time being.
1 Like
Well,
According to:
opened 03:21PM - 13 Jul 22 UTC
stale
I'd assume that in most cases it doesn't gain a lot when a compressed file is co… mpressed again when storing to the repository.
So, I think it would be helpful to ease setup, to include a list of file extensions that are known to be compressed - in such a way that they can be easily excluded from compression by a policy.
Actually, I'm not sure what would be the best way to do this. Ideas:
- store this list internally and just include another boolean flag in the policy. Hm, maybe not preferred as it is not obvious what will be excluded and the list cannot be tweaked to custom needs
- Kopia UI could include a button to add these extensions to a policy in the editor - but no idea how this could be done for the CLI version
Anyway, this is the list I'm currently using:
```
jpg
jpeg
png
svgz
mp3
m4a
ogg
avi
mov
mp4
m4v
mpg
mpeg
ogv
7z
zip
gz
xz
zst
zstd
bz2
tgz
rar
jar
war
webm
webp
docx
pptx
xlsx
```
opened 03:52PM - 22 Mar 21 UTC
closed 08:20PM - 07 May 23 UTC
stale
Global policy should probably include a set of default extensions to populate "N… ever Compress" list. At least until #812 is implemented. Compressing high-entropy files severely impacts compression speed with many algorithms, so skipping unnecessary work can increase the speed significantly.
Also, there's currently no clarification on the syntax of this list. Are `*` or `*.` necessary before extensions? Are comments supported? Empty lines?
I attach a sample list of non-compressible files (in an arbitrary format) which can be used as a starting point. Extensions are grouped by type, most are supplied with an explanatory comment.
[nevercompress.txt](https://github.com/kopia/kopia/files/6183520/nevercompress.txt)
If you don’t use really “heavy” compression methods, you don’t need “exclude” already compressed files.
I think it isn’t an answer to the question. Neither this forum, nor official program “help” or github “issues”, as well online documentation specifying correct format for the particular option:
--add-never-compress=