#!/usr/bin/python # rdiff-backup-statistics -- Summarize rdiff-backup statistics files # Version $version released $date # Copyright 2005 Dean Gaudet, Ben Escoto # # This file is part of rdiff-backup. # # rdiff-backup is free software; you can redistribute it and/or modify # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # rdiff-backup is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with rdiff-backup; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA import os, sys, re, getopt from rdiff_backup import connection, regress, rpath, Globals, restore, \ Time, lazy, FilenameMapping, robust begin_time = None # Parse statistics at or after this time... end_time = None # ... and at or before this time (epoch seconds) min_ratio = .05 # report only files/directories over this number separator = "\n" # The line separator in file_statistics file quiet = False # Suppress the "Processing statistics from session ..." lines def parse_args(): global begin_time, end_time, min_ratio, separator, quiet try: optlist, args = getopt.getopt(sys.argv[1:], "", ["begin-time=", "end-time=", "minimum-ratio=", "null-separator", "quiet"]) except getopt.error, e: sys.exit("Bad command line: " + str(e)) for opt, arg in optlist: if opt == "--begin-time": begin_time = Time.genstrtotime(arg) elif opt == "--end-time": end_time = Time.genstrtotime(arg) elif opt == "--minimum-ratio": min_ratio = float(arg) elif opt == "--null-separator": separator = '\0' elif opt == "--quiet": quiet = True else: assert 0 if len(args) != 1: sys.exit("Usage: %s [--begin-time