File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11desc "Update the development db to what is being used in prod"
22task :backup_db_rds => :environment do
3- system ( "echo Performing dump of the database." )
3+ logger = Logger . new ( STDOUT )
4+ logger . info ( "Performing dump of the database." )
45
56 current_time = Time . current . strftime ( "%Y%m%d%H%M%S" )
67
7- system ( "echo Copying of the database...")
8+ logger . info ( " Copying the database...")
89 backup_filename = "#{ current_time } .rds.dump"
910 system ( "PGPASSWORD='#{ ENV [ "DIAPER_DB_PASSWORD" ] } ' pg_dump -Fc -v --host=#{ ENV [ "DIAPER_DB_HOST" ] } --username=#{ ENV [ "DIAPER_DB_USERNAME" ] } --dbname=#{ ENV [ "DIAPER_DB_DATABASE" ] } -f #{ backup_filename } " )
1011
@@ -16,6 +17,6 @@ task :backup_db_rds => :environment do
1617 storage_access_key : account_key
1718 )
1819
19- system ( "echo Uploading #{ backup_filename } ")
20+ logger . info ( " Uploading #{ backup_filename } ")
2021 blob_client . create_block_blob ( "backups" , backup_filename , File . read ( backup_filename ) )
2122end
You can’t perform that action at this time.
0 commit comments