# frozen_string_literal: true module Meroku # Logic related to backup of production server class Backup include Meroku::Sshable def initialize @connection = Net::SSH.start('34.239.241.218', 'ubuntu', sshopts) execute_script <<~HEREDOC SECRET=#{Meroku::Shared.secrets.meroku_secret} ~/backend_api/script/backup_db SECRET=#{Meroku::Shared.secrets.meroku_secret} ~/backend_api/script/backup_etc SECRET=#{Meroku::Shared.secrets.meroku_secret} ~/backend_api/script/backup_nginxconfs SECRET=#{Meroku::Shared.secrets.meroku_secret} ~/backend_api/script/backup_homedirs HEREDOC puts 'OK' end end end