Method: Backup::Database::MongoDB#perform!
- Defined in:
- lib/backup/database/mongodb.rb
#perform! ⇒ Object
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
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/backup/database/mongodb.rb', line 114 def perform! log! begin lock_database if @lock.eql?(true) if collections_to_dump.is_a?(Array) and not collections_to_dump.empty? specific_collection_dump! else dump! end unlock_database if @lock.eql?(true) rescue => exception unlock_database if @lock.eql?(true) raise exception end end |