borg icon indicating copy to clipboard operation
borg copied to clipboard

Per-repo default parameters (chunker, compression)

Open level323 opened this issue 10 years ago • 4 comments

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:

  1. Along the lines of my example above - that is, a slew of --XXXXX-default optional arguments to the borg init command.
  2. A new borg command such as borg repo-set-defaults --chunker-params 18,23,21,4096 --compression lz4 etc that could be invoked (if desired) after borg init

Cheers

level323 avatar Oct 30 '15 06:10 level323

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.

theamk avatar Dec 25 '15 00:12 theamk

note that umask must be set rather early, so that it is in effect before any files/dirs get created.

ThomasWaldmann avatar Dec 25 '15 18:12 ThomasWaldmann

(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/.

leegarrett avatar Dec 08 '22 17:12 leegarrett

Also, you can put all these args to env and call it from script

infectormp avatar Dec 08 '22 20:12 infectormp