btrbk icon indicating copy to clipboard operation
btrbk copied to clipboard

Update `ssh_filter_btrbk.sh` to allow `stream_compress` with adaptive compression

Open zwimer opened this issue 1 year ago • 3 comments
trafficstars

Currently my btrbk.conf contains:

stream_compress_adapt      yes
stream_compress            zstd

I have my backup NAS set to run with ssh_filter_btrbk.sh. When I do it fails with something like:

ERROR: Failed to send/receive subvolume: /.btrbk_snap/home.20240903T0000 [//.btrbk_snap/home.20240902T0000] -> NAS:/mnt/main/btrbk/PC/home.20240903T0000
ERROR: ... SSH command failed (exitcode=255)
ERROR: ... sh: btrfs send -p '//.btrbk_snap/home.20240902T0000' --compressed-data '/.btrbk_snap/home.20240903T0000' | mbuffer -v 1 -q -m 256m | zstd -c --adapt | ssh -i '/root/.ssh/id_ed25519.btrbk' -o compression=no root@NAS 'zstd -d -c --adapt | btrfs receive '\''/mnt/main/btrbk/PC/'\'''
ERROR: ... ssh_filter_btrbk.sh: ssh command rejected: disallowed command (restrict-path: "/mnt/NAS/btrbk/PC"): zstd -d -c --adapt | btrfs receive '/mnt/main/btrbk/PC/'
ERROR: ... failed to check target subvolume: NAS:/mnt/main/btrbk/PC/home.20240903T0000
ERROR: ... Command execution failed (exitcode=1)

It would be nice if the default ssh_filter_btrbk.sh permitted this user of zstd.

zwimer avatar Sep 03 '24 17:09 zwimer

The problem seems to be that the regex does not allow --adapt to be passed to zstd. I might be able to PR this myself

zwimer avatar Sep 03 '24 17:09 zwimer

@digint Can I do anything to help get this merged?

zwimer avatar Oct 28 '24 14:10 zwimer

Oops, you already worked on this.

I recently created #617.

HaleTom avatar Apr 25 '25 08:04 HaleTom