mirror of https://github.com/digint/btrbk
On branch sync-after-delete
Your branch is up to date with 'origin/sync-after-delete'. Changes to be committed: modified: btrbk modified: ssh_filter_btrbk.sh btrbk: - included the btrbk filesystem sync command for btrfs-progs-sudo - inserted the btrbk filesystem sync command in between btrfs subvolume delete and btrfs subvolume sync in case "btrfs_commit_delete=sync" Rationale: The btrfs filesystem sync actually triggers the deletion of the subvolume right away. Therefore, btrfs subvolume sync does not wait so long.pull/425/head
parent
f78fd742e4
commit
6ff62cf2ba
4
btrbk
4
btrbk
|
@ -321,6 +321,7 @@ my %backend_cmd_map = (
|
|||
"btrfs subvolume snapshot" => [ "sudo", "-n", "btrfs", "subvolume", "snapshot" ],
|
||||
"btrfs subvolume delete" => [ "sudo", "-n", "btrfs", "subvolume", "delete" ],
|
||||
"btrfs subvolume sync" => [ "sudo", "-n", "btrfs", "subvolume", "sync" ],
|
||||
"btrfs filesystem sync" => [ "sudo", "-n", "btrfs", "filesystem", "sync" ],
|
||||
"btrfs send" => [ "sudo", "-n", "btrfs", "send" ],
|
||||
"btrfs receive" => [ "sudo", "-n", "btrfs", "receive" ],
|
||||
"btrfs filesystem usage" => [ "sudo", "-n", "btrfs", "filesystem", "usage" ],
|
||||
|
@ -1477,6 +1478,9 @@ sub btrfs_subvolume_delete($@)
|
|||
fatal_stderr => sub { m/^ERROR: /; }, # probably not needed, "btrfs sub delete" returns correct exit status
|
||||
filter_stderr => \&_btrfs_filter_stderr,
|
||||
);
|
||||
$ret = run_cmd(cmd => vinfo_cmd($target, "btrfs filesystem sync", { unsafe => $target->{VINFO_MOUNTPOINT}{PATH} } ),
|
||||
rsh => vinfo_rsh($target),
|
||||
);
|
||||
$ret = run_cmd(cmd => vinfo_cmd($target, "btrfs subvolume sync", { unsafe => $target->{VINFO_MOUNTPOINT}{PATH} }, $target->{node}{id} ),
|
||||
rsh => vinfo_rsh($target),
|
||||
);
|
||||
|
|
|
@ -140,6 +140,8 @@ while [[ "$#" -ge 1 ]]; do
|
|||
|
||||
-d|--delete)
|
||||
allow_cmd "${sudo_prefix}btrfs subvolume delete"
|
||||
allow_cmd "${sudo_prefix}btrfs subvolume sync"
|
||||
allow_cmd "${sudo_prefix}btrfs filesystem sync"
|
||||
;;
|
||||
|
||||
-i|--info)
|
||||
|
|
Loading…
Reference in New Issue