Class: Synco::Methods::ZFS
- Inherits:
-
Synco::Method
- Object
- Controller
- Synco::Method
- Synco::Methods::ZFS
- Defined in:
- lib/synco/methods/zfs.rb
Instance Attribute Summary
Attributes inherited from Synco::Method
Attributes inherited from Controller
Instance Method Summary collapse
Methods inherited from Synco::Method
Methods inherited from Controller
#abort!, build, #fire, #freeze, #initialize, #on, #try
Constructor Details
This class inherits a constructor from Synco::Method
Instance Method Details
#call(scope, arguments: []) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/synco/methods/zfs.rb', line 15 def call(scope, arguments: []) from_server = scope.current_server master_server = scope.master_server target_server = scope.target_server directory = scope.directory send_command = [ *@command, "send", master_server.full_path(directory) ] receive_command = [ *@command, "receive", target_server.full_path(directory) ] input, output = IO.pipe Fiber.new do master_server.run(*send_command, out: output, from: from_server) output.close end.resume target_server.run(*receive_command, in: input, from: from_server) input.close end |
#default_command ⇒ Object
11 12 13 |
# File 'lib/synco/methods/zfs.rb', line 11 def default_command ["zfs", "-rnv"] end |