pull/574/merge
Bernhard Kaszt 2025-07-11 01:10:48 +01:00 committed by GitHub
commit 4a398f5989
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,7 @@
unreleased
* Add "synology" compat option for Synology NAS.
btrbk-0.32.6
* Fix backup of unrelated (by parent_uuid) snapshots (close #339).

8
btrbk
View File

@ -142,9 +142,9 @@ my %config_options = (
backend_remote => { default => undef, accept => [qw( no btrfs-progs btrfs-progs-btrbk btrfs-progs-sudo btrfs-progs-doas )] },
backend_local_user => { default => undef, accept => [qw( no btrfs-progs btrfs-progs-btrbk btrfs-progs-sudo btrfs-progs-doas )] },
compat => { default => undef, accept => [qw( no busybox ignore_receive_errors )], split => 1 },
compat_local => { default => undef, accept => [qw( no busybox ignore_receive_errors )], split => 1 },
compat_remote => { default => undef, accept => [qw( no busybox ignore_receive_errors )], split => 1 },
compat => { default => undef, accept => [qw( no busybox ignore_receive_errors synology )], split => 1 },
compat_local => { default => undef, accept => [qw( no busybox ignore_receive_errors synology )], split => 1 },
compat_remote => { default => undef, accept => [qw( no busybox ignore_receive_errors synology )], split => 1 },
safe_commands => { default => undef, accept => [qw( yes no )], context => [qw( global )] },
btrfs_commit_delete => { default => undef, accept => [qw( yes no after each )],
deprecated => { MATCH => { regex => qr/^(?:after|each)$/, warn => 'Please use "btrfs_commit_delete yes|no"', replace_key => "btrfs_commit_delete", replace_value => "yes" } } },
@ -1461,11 +1461,13 @@ sub _btrfs_send_options($$;$$)
my $clone_src = shift // [];
my $send_protocol = config_key($target, "send_protocol");
my $send_compressed_data = config_key($target, "send_compressed_data");
my $compat_synology = config_key_lru($target, "compat", "synology");
my @send_options;
push(@send_options, '-p', { unsafe => $parent->{PATH} } ) if($parent);
push(@send_options, '-c', { unsafe => $_ } ) foreach(map { $_->{PATH} } @$clone_src);
push(@send_options, '--proto', $send_protocol ) if($send_protocol);
push(@send_options, '--compressed-data' ) if($send_compressed_data);
push(@send_options, '--without-syno-features' ) if($compat_synology);
#push(@send_options, '-v') if($loglevel >= 3);
return \@send_options;
}

View File

@ -202,3 +202,18 @@ volume ssh://my-remote-host.com/mnt/btr_pool
snapshot_preserve_min all
subvolume home
target /mnt/btr_backup/my-remote-host.com
# Archive all shared folders from a Synology NAS btrfs.
# Needs an admin account with SSH key login.
volume ssh://my-synology-host.com/volume1
subvolume *
compat synology
snapshot_dir btrbk_snapshots
snapshot_create ondemand
snapshot_preserve_min latest
snapshot_preserve no
target_preserve_min 6m
target_preserve 10d 10w 12m
target /mnt/btr_backup/my-synology-host.com

View File

@ -417,6 +417,12 @@ with "ERROR: attribute 12 requested but not present".
Note that there is *no guarantee that backups created with this
option enabled can be restored at all*.
*synology*::
Useful when transfering snapshots from Synology DSM NAS systems, that
are normally not compatible with standard Btrfs systems and sending
would cause a lot of ACL errors. When this is enabled, the option
`--without-syno-features` is passed to `btrfs send`.
If you want to set this option for local or remote hosts only, set
*compat_local* or *compat_remote* (e.g. "compat_remote busybox").
--