summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2014-06-25 16:12:16 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2014-06-25 16:12:16 +0100
commit1b0f1e1fcd32df9f475307a86ad79460d983e58c (patch)
tree3a698572a079f8105ec860933e0a51f3587eac34
parent7cc7836b6e9a332ebdc6f3999f743b6aa0630fa3 (diff)
Fixed order of inject
-rwxr-xr-xbyteback-snapshot6
1 files 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')",