set home so .my.cnf is found as we run it as cron weekly

This commit is contained in:
mh 2009-02-22 13:07:39 +00:00
parent 95c5cd82d9
commit d4cccaa62f

View file

@ -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/)