retry_calls( lambda: cache.commit(), onError_default) if len(failedChecks): logging.error("\n\n") logging.error("!"*80) logging.error("! fullHash check failed!") for o in failedChecks: logging.error("! path: %s" % (o['np'])) logging.error("! fullHash: %s" % (o['hash'])) logging.error("! expected: %s\n\n" % (o['fullHash'])) logging.error("") logging.error("") logging.error("found %d failed files, out of %d" % (len(failedChecks), len(files))) logging.error("!"*80) if args['verbose']==1: for o in failedChecks: print("%s" % (o['np'])) sys.exit(1) else: logging.info("check done, all good") hh.destroy() analyzer.destroy() cache.destroy() wrt.destroy()
print "files changed in the last 7 days: % 6d (%6.1f%%)" % (cnt, 100*(float(cnt)/total)) dt = datetime.datetime.now() - datetime.timedelta(days=14) cnt = analyzer.getFilesCountChangedAfter(dt) print "files changed in the last 14 days: % 6d (%6.1f%%)" % (cnt, 100*(float(cnt)/total)) dt = datetime.datetime.now() - datetime.timedelta(days=31) cnt = analyzer.getFilesCountChangedAfter(dt) print "files changed in the last 31 days: % 6d (%6.1f%%)" % (cnt, 100*(float(cnt)/total)) dt = datetime.datetime.now() - datetime.timedelta(days=365) cnt = analyzer.getFilesCountChangedAfter(dt) print "files changed in the last 365 days: % 6d (%6.1f%%)" % (cnt, 100*(float(cnt)/total)) elif args['mode']=='flags': if not cache.getFlag('app.run.first') is None: print "first run: %s" % ( datetime.datetime.fromtimestamp(int(cache.getFlag('app.run.first'))).strftime('%Y-%m-%d %H:%M:%S')) print "last run: %s" % ( datetime.datetime.fromtimestamp(int(cache.getFlag('app.run.last'))).strftime('%Y-%m-%d %H:%M:%S')) print "run count: %s" % ( cache.getFlag('app.run.count')) print "hasher.name: %s" % ( cache.getFlag('hasher.name')) else: print "first run: %s" % ( "2000-01-01 00:00:01" ) print "last run: %s" % ( "2000-01-01 00:00:01" ) print "run count: %s" % ( 0 ) print "hasher.name: %s" % ( '' ) analyzer.destroy() cache.destroy()