s3_db_assets_backup 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ namespace :db do
|
|
13
13
|
file_name = "#{RAILS_ENV}_dump-#{datestamp}.sql.gz"
|
14
14
|
backup_file = File.join(base_path, "tmp", file_name)
|
15
15
|
db_config = ActiveRecord::Base.configurations[RAILS_ENV]
|
16
|
-
sh "mysqldump -u #{db_config['username']} -p#{db_config['password']} --default-character-set=latin1 -N -Q --add-drop-table
|
16
|
+
sh "mysqldump -u #{db_config['username']} -p#{db_config['password']} --default-character-set=latin1 -N -Q --add-drop-table #{db_config['database']} | gzip -c > #{backup_file}"
|
17
17
|
AWS::S3::S3Object.store(file_name, open(backup_file), BUCKET)
|
18
18
|
puts "Created backup: #{file_name}"
|
19
19
|
FileUtils.rm_rf(backup_file)
|