diff options
author | mh <mh@immerda.ch> | 2010-04-04 12:27:12 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2010-04-04 12:27:12 +0200 |
commit | 828e93c72dd0b8d321a2b53901117793ecd74ef3 (patch) | |
tree | bec878d9fc29688bb4492aab48eda7168ae1fa49 /files | |
parent | d40e1130bc3b8ed5f929406952d1bb598c92a381 (diff) |
as we are in ruby we need to double escape that
Diffstat (limited to 'files')
-rw-r--r-- | files/scripts/optimize_tables.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/files/scripts/optimize_tables.rb b/files/scripts/optimize_tables.rb index 1aaf51c..46e223e 100644 --- a/files/scripts/optimize_tables.rb +++ b/files/scripts/optimize_tables.rb @@ -5,7 +5,7 @@ ENV['HOME'] = '/root' tables = %x{mysql -Bse "SELECT TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema','mysql') AND Data_free > 0 AND ENGINE IN ('MyISAM','InnoDB','ARCHIVE')"} tables.each { |table| tableitems = table.chomp.split(/\t/) - system "mysql #{tableitems[0]} -Bse \"OPTIMIZE TABLE \`#{tableitems[0]}\`.\`#{tableitems[1]}\`\" | grep -q OK" + system "mysql #{tableitems[0]} -Bse \"OPTIMIZE TABLE \\`#{tableitems[0]}\\`.\\`#{tableitems[1]}\\`\" | grep -q OK" if $?.to_i > 0 then puts "error while optimizing #{tableitems[0]}.#{tableitems[1]}" end |