Easy to use function to delete a snapshot by it's ID
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
return;
}
+#
+## Easy to use function to delete a snapshot by it's ID.
+##
+## Requires the numeric ID of the snapshot.
+#
+sub btrfs_remove_snapshot ($) {
+ my ($id) = @_;
+
+ # Call the btrfsctrl binary to delete the requested snapshot.
+ my $ret = &General::system("$btrfsctrl", "snapshot-delete", "$id");
+
+ # Return the error code if there was one.
+ return $ret if ($ret);
+
+ # Return nothing on success.
+ return;
+}
+
#
## Private function to filter the output of btrfs_subvolume_list command.
##