[pve-devel] [PATCH zsync 07/10] add create_file_system function

Fabian Ebner f.ebner at proxmox.com
Tue May 4 10:10:01 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 pve-zsync | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/pve-zsync b/pve-zsync
index a327d42..101dc03 100755
--- a/pve-zsync
+++ b/pve-zsync
@@ -171,6 +171,19 @@ sub check_dataset_exists {
     return 1;
 }
 
+sub create_file_system {
+    my ($file_system, $ip, $user) = @_;
+
+    my $cmd = [];
+
+    if ($ip) {
+	push @$cmd, 'ssh', "$user\@$ip", '--';
+    }
+    push @$cmd, 'zfs', 'create', $file_system;
+
+    run_cmd($cmd);
+}
+
 sub parse_target {
     my ($text) = @_;
 
-- 
2.20.1






More information about the pve-devel mailing list