Class: Dump
- Inherits:
-
Object
- Object
- Dump
- Defined in:
- lib/dump_create.rb
Class Method Summary collapse
Class Method Details
.construct(username, database, *host) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/dump_create.rb', line 4 def self.construct(username, database, *host) unless File.directory?('temporary') system 'mkdir temporary' end if host.size==2 system "mysqldump -u #{username} -p#{host[0]} -h#{host[1]} #{database} > temporary/$(date +%F__%T).sql" else system "mysqldump -u #{username} -h#{host[0]} #{database} > temporary/$(date +%F__%T).sql" end end |