From d4cccaa62fcd30b28fef076827ef1aad9e5b1eb9 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 22 Feb 2009 13:07:39 +0000 Subject: set home so .my.cnf is found as we run it as cron weekly --- files/optimize/optimize_tables.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'files') diff --git a/files/optimize/optimize_tables.rb b/files/optimize/optimize_tables.rb index da4515b..52e726e 100644 --- a/files/optimize/optimize_tables.rb +++ b/files/optimize/optimize_tables.rb @@ -1,5 +1,7 @@ #!/usr/bin/env ruby +# set home as we runit as weekly cron, where HOME is / +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/) -- cgit v1.2.3