Per-repo default parameters (chunker, compression)
I think usability of borg could be improved by being able to set default values for certain options at repo initialisation time.
For example: borg init --chunker-params-default 18,23,21,4096 -compression-default lz4 my-vm-image-repo
Per the above example, any subsequent borg create invocation would use the chunker params and compression defaults specified above, but could be overridden by explicitly specifying the standard --chunker-params and/or -C arguments following borg create
Creating per-repo defaults for chunker params and compression would scratch my immediate itch, but on further thought there are many other post-init invocation arguments for which per-repo defaults may improve usability, such as umask. no-files-cache, etc.
The most obvious ways to implement this feature would be either:
- Along the lines of my example above - that is, a slew of
--XXXXX-defaultoptional arguments to theborg initcommand. - A new borg command such as
borg repo-set-defaults --chunker-params 18,23,21,4096 --compression lz4etc that could be invoked (if desired) afterborg init
Cheers
One way to solve this is to extend the capabilities of the /config file in the remote repository. It already has segments_per_dir and max_segment_size ; other per-repository parameters like chunker-params, compression, and umask seem like a natural fit there.
This will eventually require command line options to edit as described in the bug, but for the first version the user can just edit the file.
note that umask must be set rather early, so that it is in effect before any files/dirs get created.
(Sorry to grave dig this bug) +1 to this.
My current line for making backups is:
BORG_CACHE_DIR=/mnt/target/borg_cache_batou /usr/bin/borg create --progress --stats --exclude-from /home/randall/Coding/randallscripts/borg_exclude_patterns --exclude-caches --noatime --nobsdflags --noxattrs /mnt/target/batou::batou_$(date -Iminute) .
That's impossible to memorize, and currently any command (e.g. recreate) involves copy/pasting that around, which is not very practical.
It would be a great feature to be able to set it per-repo in ./config, or per-user in ~/.config/borg/.
Also, you can put all these args to env and call it from script