From 1b0f1e1fcd32df9f475307a86ad79460d983e58c Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 25 Jun 2014 16:12:16 +0100 Subject: Fixed order of inject --- byteback-snapshot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/byteback-snapshot b/byteback-snapshot index 37fae68..5a7b8e8 100755 --- a/byteback-snapshot +++ b/byteback-snapshot @@ -121,12 +121,12 @@ class BackupDirectory # http://dustymabe.com/2013/09/22/btrfs-how-big-are-my-snapshots/ # but it's not currently in Debian/wheezy. # - def snapshot_size(time=snapshot_times.latest) + def snapshot_size(time=snapshot_times.last) `du -s -b #{snapshot_path(time)}`.to_i end def average_snapshot_size(number=10) - snapshot_times.sort[0..number].inject(0) { |time, total| snapshot_size(time) } / number + snapshot_times.sort[0..number].inject(0) { |total, time| snapshot_size(time) } / number end # Create a new snapshot of 'current' @@ -163,7 +163,7 @@ opts = Trollop::options do opt :snapshot, "Take a new snapshot" - opt :prune, "Prune old backups", + opt :prune, "Prune old backups (by 'age' or 'importance')", :type => :string opt :list, "List backups (by 'age' or 'importance')", -- cgit v1.2.1