Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
8 changes: 5 additions & 3 deletions btrbk
Original file line number Diff line number Diff line change
Expand Up @@ -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" } } },
Expand Down Expand Up @@ -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;
}
Expand Down
15 changes: 15 additions & 0 deletions btrbk.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions doc/btrbk.conf.5.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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").
--
Expand Down