Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active December 30, 2015 06:39
Show Gist options
  • Select an option

  • Save raphink/7790812 to your computer and use it in GitHub Desktop.

Select an option

Save raphink/7790812 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'mcollective'
include MCollective::RPC
mc = rpcclient('fsfreeze')
mc.discovery_method = 'mc'
all_nodes = mc.discover.clone
all_nodes.in_groups_of(5) do |nodes|
mc.reset
mc.discover :nodes => nodes.compact
mc.fsfreeze(:filesystem => 'ALL') do |resp|
puts "Launching backup for #{resp[:senderid]}"
end
mc.fsunfreeze(:filesystem => 'ALL')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment