Creates a new instance of the MongoDB database object
# File lib/backup/database/mongodb.rb, line 48 def initialize(model, &block) super(model) @only_collections ||= Array.new @additional_options ||= Array.new @ipv6 ||= false @lock ||= false instance_eval(&block) if block_given? @mongodump_utility ||= utility(:mongodump) @mongo_utility ||= utility(:mongo) end
Performs the mongodump command and outputs the data to the specified path based on the 'trigger'. If the user hasn't specified any specific collections to dump, it'll dump everything. If the user has specified collections to dump, it'll loop through the array of collections and invoke the 'mongodump' command once per collection
# File lib/backup/database/mongodb.rb, line 68 def perform! super lock_database if @lock @only_collections.empty? ? dump! : specific_collection_dump! rescue => err raise Errors::Database::MongoDBError.wrap(err, 'Database Dump Failed!') ensure unlock_database if @lock package! unless err end
Generated with the Darkfish Rdoc Generator 2.