diff options
author | mh <mh@immerda.ch> | 2009-02-22 13:07:39 +0000 |
---|---|---|
committer | mh <mh@immerda.ch> | 2009-02-22 13:07:39 +0000 |
commit | d4cccaa62fcd30b28fef076827ef1aad9e5b1eb9 (patch) | |
tree | 3e22ea8b51e905e6c3eafcc6b0eb4cfe926a8478 /files | |
parent | 95c5cd82d9ef2b9b256dddf44531eb0bbf36a09f (diff) |
set home so .my.cnf is found as we run it as cron weekly
Diffstat (limited to 'files')
-rw-r--r-- | files/optimize/optimize_tables.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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/) |