Skip to content

Commit

Permalink
Emit a terse set of summary information when verbose is not on, rather
Browse files Browse the repository at this point in the history
than nothing much at all.
  • Loading branch information
jpieper committed Jul 31, 2013
1 parent 8a14ae3 commit 815a2a9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions s3bdbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def get_current_name(storage):


def do_backup(args):
start_time = time.time()

storage = make_storage(args)
block = open(args.block, 'rb')
progress = Progress(args, 'backup')
Expand Down Expand Up @@ -283,7 +285,10 @@ def update_progress(count, total):

if args.verbose:
print ' ' * 75,
print "\nWrote backup to: '%s'" % manifest_name

end_time = time.time()
print "\nWrote backup to: '%s' in %d seconds" % (
manifest_name, int(end_time - start_time))

if args.limit is not None:
do_limit(storage, args)
Expand Down Expand Up @@ -468,15 +473,14 @@ def do_limit(storage, args):
if len(manifests) < limit:
return

print 'Existing backups exceed limit, %d > %d' % (
len(manifests), limit)
if args.verbose:
print 'Existing backups exceed limit, %d > %d' % (
len(manifests), limit)
print ''.join([' %s\n' % x for x in manifests])

while len(manifests) > limit:
to_remove = select_manifest_to_remove(manifests)
if args.verbose:
print "Purging old backup manifest: '%s'" % to_remove
print "Purging old backup manifest: '%s'" % to_remove
storage.remove(to_remove)
manifests.remove(to_remove)

Expand Down

0 comments on commit 815a2a9

Please # to comment.