1

Is it possible to change the number of threads for the xz command in the filesystem backup module? I would like to use all of the available cpu's on my system. I have tried to add --threads=0 in the Extra command-line parameters but it does not work giving error.

The error is:

tar: unrecognized option '--threads=0' Try 'tar --help' or 'tar --usage' for more information.

So it seems the options are passed to tar and not xz.

2 Answers2

4

Use the XZ_DEFAULTS environment variable. For example, put this in your system-wide /etc/profile:

export XZ_DEFAULTS='--threads=0'
Geremia
  • 151
  • 6
1

Parallel compression will not get to the theoretical maximum throughput for a number of reasons. Most obvious of which, only recently has the man page admitted that xz --threads has been implemented.


With only options to GNU tar, you can provide your own compression wrapper: --use-compress-program=/usr/local/bin/xz-thread.sh

Where xz-thread.sh is a thin wrapper script that passes all the arguments it gets and adds some more:

#!/bin/sh
xz --threads=0 "$@"

In a similar way, you can substitute xz with other compress programs with gzip-like syntax, like zstd.

John Mahowald
  • 36,071