Skip to content

Instantly share code, notes, and snippets.

/bakup.rb Secret

Created December 6, 2013 14:58
Show Gist options
  • Save anonymous/99f2b4255f08858737b7 to your computer and use it in GitHub Desktop.
Save anonymous/99f2b4255f08858737b7 to your computer and use it in GitHub Desktop.
require 'rubygems' if RUBY_VERSION < '1.9'
require 'date'
require 'fileutils'
require 'net/ssh'
require 'open3'
class CommandFailed < StandardError
end
class BackupMysql < StandardError
def initialize(uid_instance)
if uid_instance.nil?
puts "please give a uid instance to backup"
@uid_instance = gets.chomp
else
@uid_instance = uid_instance
@user ='root'
@uid_instance= ARGV[0]
@res_uid_instance= @uid_instance
@host ='192.168.160.44'
@pwd ="Linux_2306"
@mysl_dump ="/usr/bin/mysqldump"
@mysql_user = "root"
@mysql_password = "Linux_2306"
backup
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment