Class: Astrails::Safe::Mongodump

Inherits:
Source show all
Defined in:
lib/astrails/safe/mongodump.rb

Instance Attribute Summary

Attributes inherited from Source

#id

Attributes inherited from Stream

#backup, #config

Instance Method Summary collapse

Methods inherited from Source

#backup, #filename, #initialize, #kind, #timestamp

Methods inherited from Stream

#expand, #initialize

Constructor Details

This class inherits a constructor from Astrails::Safe::Source

Instance Method Details

#commandObject



5
6
7
8
9
10
11
12
13
# File 'lib/astrails/safe/mongodump.rb', line 5

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

#extensionObject



15
# File 'lib/astrails/safe/mongodump.rb', line 15

def extension; '.tar'; end