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/