From 072dd7202239e282596b6eeab417340ee3716305 Mon Sep 17 00:00:00 2001 From: Per Persson Date: Wed, 13 Mar 2013 17:08:12 +0100 Subject: [PATCH] Update split-mysql-dump.rb Catch errors thrown from Dir.mkdir. The script died for me because directories already existed. This helped. I haven't investigated why I had several "Current Database" for the same database, so maybe the problem would better be solved in another way. --- split-mysql-dump.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/split-mysql-dump.rb b/split-mysql-dump.rb index a691e25..b53d8c7 100755 --- a/split-mysql-dump.rb +++ b/split-mysql-dump.rb @@ -93,8 +93,12 @@ def bytes_to_human db = $1 table = nil outfile.close if outfile and !outfile.closed? - Dir.mkdir(db) - Dir.mkdir("#{db}/tables") + begin + Dir.mkdir(db) + Dir.mkdir("#{db}/tables") + rescue + # Catch errors + end outfile = File.new("#{db}/create.sql", "w") puts("\n\nFound a new db: #{db}") elsif line =~ /^-- Position to start replication or point-in-time recovery from/