diff --git a/ChangeLog b/ChangeLog index 5fb1f7c..019f57c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/btrbk b/btrbk index 3325163..f62ac5c 100755 --- a/btrbk +++ b/btrbk @@ -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; } diff --git a/btrbk.conf.example b/btrbk.conf.example index 49ede27..3d1eaeb 100644 --- a/btrbk.conf.example +++ b/btrbk.conf.example @@ -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 diff --git a/doc/btrbk.conf.5.asciidoc b/doc/btrbk.conf.5.asciidoc index 04f8e4d..e5f5a4c 100644 --- a/doc/btrbk.conf.5.asciidoc +++ b/doc/btrbk.conf.5.asciidoc @@ -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"). --