Skip to content

Commit 64c75a6

Browse files
authored
Use standard out logger instead of system echo (#4787)
1 parent 11541b1 commit 64c75a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/tasks/backup_db_rds.rake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
desc "Update the development db to what is being used in prod"
22
task :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))
2122
end

0 commit comments

Comments
 (0)