From d8d4e8ba0a47fa33daafb594fa5cf3fa19bf305c Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 18 Jun 2013 00:39:09 -0400 Subject: [PATCH] adding db reorganize() to keep the size down --- bin/bash_history.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/bash_history.rb b/bin/bash_history.rb index 1d8a44d..98a8132 100755 --- a/bin/bash_history.rb +++ b/bin/bash_history.rb @@ -67,11 +67,14 @@ exit(0) if options[:migrate] bh = Persistent::Shell::BinaryHistoryStore.new(bh_options) # load the new bash_history into the database -bh.load() unless (options[:inspect] or options[:find] or options[:list]) +unless (options[:inspect] or options[:find] or options[:list]) + bh.load() + bh.db.reorganize() +end if options[:inspect] p bh - p "storing #{bh.keys.count} commands" + #p "storing #{bh.keys.count} commands" end if options[:find] bh.find(options[:find]).sort_by {|x| x[:time] }.each do |val|