diff --git a/ChangeLog b/ChangeLog index ca994bb..ffa99f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ btrbk-current * Added configuration option "ssh_port" (close: #39). + * Added configuration option "ssh_compression" (close: #44). * Added command line option "--progress" (close: #42). btrbk-0.19.3 diff --git a/btrbk b/btrbk index a32abce..5a8c55b 100755 --- a/btrbk +++ b/btrbk @@ -76,6 +76,7 @@ my %config_options = ( ssh_identity => { default => undef, accept_file => { absolute => 1 } }, ssh_user => { default => "root", accept_regexp => qr/^[a-z_][a-z0-9_-]*$/ }, ssh_port => { default => "default", accept => [ "default" ], accept_numeric => 1 }, + ssh_compression => { default => undef, accept => [ "yes", "no" ] }, btrfs_progs_compat => { default => undef, accept => [ "yes", "no" ] }, # deprecated options @@ -230,12 +231,14 @@ sub vinfo($$) ); if($url =~ /^ssh:\/\/(\S+?)(\/\S+)$/) { - my ($host, $path) = ($1, $2); - my $ssh_port = config_key($config, "ssh_port"); - my $ssh_user = config_key($config, "ssh_user"); - my $ssh_identity = config_key($config, "ssh_identity"); + my ($host, $path) = ($1, $2); + my $ssh_port = config_key($config, "ssh_port"); + my $ssh_user = config_key($config, "ssh_user"); + my $ssh_identity = config_key($config, "ssh_identity"); + my $ssh_compression = config_key($config, "ssh_compression"); my @ssh_options; push(@ssh_options, '-p', $ssh_port) if($ssh_port ne "default"); + push(@ssh_options, '-C') if($ssh_compression); if($ssh_identity) { push(@ssh_options, '-i', $ssh_identity); } else { diff --git a/btrbk.conf.example b/btrbk.conf.example index 76be6c3..6238cbf 100644 --- a/btrbk.conf.example +++ b/btrbk.conf.example @@ -52,6 +52,7 @@ snapshot_dir _btrbk_snap #ssh_identity /etc/btrbk/ssh/id_ed25519 #ssh_user root #ssh_port default +#ssh_compression no # Don't wait for transaction commit on deletion. Set this to "after" # or "each" to make sure the deletion of subvolumes is committed to diff --git a/doc/btrbk.conf.5 b/doc/btrbk.conf.5 index 965aaaa..85b0702 100644 --- a/doc/btrbk.conf.5 +++ b/doc/btrbk.conf.5 @@ -120,6 +120,10 @@ have to make sure that the remote user is able to run /sbin/btrfs Port to connect to on the remote host. Defaults to \[lq]default\[rq] (the port specified in \fIssh_config\fR, which defaults to 22). .TP +\fBssh_compression\fR yes|no +Enables or disables the compression of ssh connections. Defaults to +\[lq]no\[rq]. +.TP \fBbtrfs_commit_delete\fR after|each|no If set, make sure the deletion of snapshot and backup subvolumes are committed to disk when btrbk terminates. Defaults to \[lq]no\[rq].