Skip to content

Instantly share code, notes, and snippets.

View zlorfi's full-sized avatar
😁
Happy

Michael zlorfi

😁
Happy
  • time:matters GmbH
  • Frankfurt am Main, Germany
View GitHub Profile
#!/usr/bin/env ruby
#Pre-requisite: gem install mail (https://github.com/mikel/mail)
require 'mail'
mysql_username = 'root'
mysql_password = '123456'
mysql_database = 'your database' # consider use of ARGV
file_suffix = Time.new.strftime('%Y%m%d_%H%M%S')
mysql_backup_file = "backup-#{mysql_database}-#{file_suffix}.sql.gz"