# File lib/hydra/sync.rb, line 59
    def self.sync_many opts
      opts.stringify_keys!
      config_file = opts.delete('config') { nil }
      if config_file
        opts.merge!(YAML.load_file(config_file).stringify_keys!)
      end
      @verbose = opts.fetch('verbose') { false }
      @sync = opts.fetch('sync') { {} }

      workers_opts = opts.fetch('workers') { [] }
      @remote_worker_opts = []
      workers_opts.each do |worker_opts|
        worker_opts.stringify_keys!
        if worker_opts['type'].to_s == 'ssh'
          @remote_worker_opts << worker_opts
        end
      end

      trace "Initialized"
      trace "  Sync:   (#{@sync.inspect})"
      trace "  Workers: (#{@remote_worker_opts.inspect})"

      Thread.abort_on_exception = true
      trace "Processing workers"
      @listeners = []
      @remote_worker_opts.each do |worker_opts|
        @listeners << Thread.new do
          begin
            trace "Syncing #{worker_opts.inspect}"
            Sync.new worker_opts, @sync, @verbose
          rescue 
            trace "Syncing failed [#{worker_opts.inspect}]"
          end
        end
      end
      
      @listeners.each{|l| l.join}
    end