This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :db do | |
| DUMP_FMT = 'p' # 'c', 'p', 't', 'd' | |
| desc 'Dumps the database to backups' | |
| task sql_dump: :environment do | |
| dump_sfx = suffix_for_format(DUMP_FMT) | |
| backup_dir = backup_directory(true) | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| file_name = Time.now.strftime("%Y%m%d%H%M%S") + "_" + db + '.' + dump_sfx |