Skip to content

Commit

Permalink
Clock backup fix (#4748)
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaiid authored Oct 28, 2024
1 parent 558e28a commit ea423bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ module Clockwork
rake = Rake.application
rake.init
rake.load_rakefile
rake["backup_db"].invoke
rake["backup_db_rds"].invoke
end
end
4 changes: 2 additions & 2 deletions lib/tasks/backup_db_rds.rake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
desc "Update the development db to what is being used in prod"
task :backup_db => :environment do
task :backup_db_rds => :environment do
system("echo Performing dump of the database.")

current_time = Time.current.strftime("%Y%m%d%H%M%S")

system("echo Copying of the database...")
backup_filename = "#{current_time}.rds.dump"
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}")
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}")

account_name = ENV["AZURE_STORAGE_ACCOUNT_NAME"]
account_key = ENV["AZURE_STORAGE_ACCESS_KEY"]
Expand Down

0 comments on commit ea423bf

Please sign in to comment.