    # File lib/facets/more/uploadutils.rb, line 138
      def rsync( keys )
        keys = upload_parameters(keys)

        flags = []
        flags << "-n" if keys.dryrun
        flags << "-q" if keys.quiet
        flags << "-v" if keys.verbose
        flags << "--progress" unless keys.quiet
        flags = flags.join(' ').strip
        flags = ' ' + flags unless flags.empty?

        manfile = 'Publish.txt'

        if keys.stage
          dir = stage_linkdir(keys.dir, keys.stage)
          Dir.chdir(dir) do
            cpy = files(keys.copy)
          end
          manifest = File.join(dir,manfile)
          cmd = %{rsync#{flags} -L -arz --files-from='#{manifest}' #{dir} #{keys.user}@#{keys.host}:/#{keys.root}}
        else
          dir = keys.dir
          cpy = files(dir, keys.copy)
          manifest = File.join(dir,manfile)
          cmd = %{rsync#{flags} -arz --files-from='#{manifest}' #{dir} #{keys.user}@#{keys.host}:/#{keys.root}}
        end

        #Dir.chdir(keys.dir) do
          begin
            File.open(manifest, 'w'){ |f| f << cpy.join("\n") }
            ENV['RSYNC_PASSWORD'] = keys.pass if keys.pass
            puts cmd unless keys.quiet
            system cmd
          ensure
            ENV.delete('RSYNC_PASSWORD') if keys.pass
          end
        #end

      end