#912 PR merged
: use BACKUP_PROG_COMPRESS_OPTIONS as an array (issue904)¶
Labels: enhancement
, fixed / solved / done
jsmeix opened issue at 2016-07-13 13:32:¶
Implemented enhancement https://github.com/rear/rear/issues/904
BACKUP_PROG_COMPRESS_OPTIONS is now an array
so that one can use it to provide more complex values.
E.g. to override the gzip default compression level (-6)
via the tar '-I' option like
BACKUP_PROG_COMPRESS_OPTIONS=( -I 'gzip -9 -n -c' )
But using it with command options (as in 'gzip -9')
fails with tar versions before 1.27 with a tar error
message like "gzip -9: Cannot exec" because only
since tar version 1.27 tar supports passing command
line arguments to external commands, see
http://git.savannah.gnu.org/cgit/tar.git/plain/NEWS?id=release_1_27
jsmeix commented at 2016-07-13 13:38:¶
I tested it on SLES12 SP1 with tar version 1.27.1
both with
BACKUP_PROG_COMPRESS_OPTIONS=( -I 'gzip -9 -n -c' )
and also without it i.e. using the default
BACKUP_PROG_COMPRESS_OPTIONS=( --gzip )
from usr/share/rear/conf/default.conf
and for me it "just works".
In case of
BACKUP_PROG_COMPRESS_OPTIONS=( -I 'gzip -9 -n -c' )
the backup.log file contains (long line shown wrapped here):
++ tar --warning=no-xdev --sparse --block-number --totals --verbose --no-wildcards-match-slash --one-file-system --ignore-failed-read --anchored -I 'gzip -9 -n -c' -X ...
In case of the new default
BACKUP_PROG_COMPRESS_OPTIONS=( --gzip )
and also with the old default
BACKUP_PROG_COMPRESS_OPTIONS="--gzip"
the backup.log file contains (long line shown wrapped here):
++ tar --warning=no-xdev --sparse --block-number --totals --verbose --no-wildcards-match-slash --one-file-system --ignore-failed-read --anchored --gzip -X ...
jsmeix commented at 2016-07-13 13:47:¶
I don't think there could be regressions.
Therefore I merge it.
[Export of Github issue for rear/rear.]