def do_new_snapshots(datasets, interval)
snapshot_name = snapshot_name(interval)
threads = []
datasets['single'].each do |dataset|
threads << Thread.new do
Zfs::Snapshot.create("#{dataset.name}@#{snapshot_name}", 'db' => dataset.db)
end
threads.last.join unless $use_threads
end
datasets['recursive'].each do |dataset|
threads << Thread.new do
Zfs::Snapshot.create("#{dataset.name}@#{snapshot_name}", 'recursive' => true, 'db' => dataset.db)
end
threads.last.join unless $use_threads
end
threads.each { |th| th.join }
end