Sha256: 19ed9dd23b954be57fa1dd62abfa7ddc2184123e03650fdf58d89c5d60ae2946

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

module WebTranslateIt
  module Safe
    class Mongodump < Source
      
      def command
        opts = []
        opts << "--host #{config[:host]}" if config[:host]
        opts << "-u #{config[:user]}" if config[:user]
        opts << "-p #{config[:password]}" if config[:password]
        opts << "--out #{output_directory}"
      
        "mongodump -q \"{xxxx : { \\$ne : 0 } }\" --db #{@id} #{opts.join(" ")} && cd #{output_directory} && tar cf - ."
      end
    
      def extension; '.tar'; end
      
      protected
      def output_directory
        File.join(TmpFile.tmproot, 'mongodump')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webtranslateit-safe-0.4.3 lib/webtranslateit/safe/mongodump.rb
webtranslateit-safe-0.4.2 lib/webtranslateit/safe/mongodump.rb
webtranslateit-safe-0.4.1 lib/webtranslateit/safe/mongodump.rb