Пример #1
0
    logging.basicConfig(format="%(asctime)s:%(levelname)s:%(message)s", level=logging.DEBUG, datefmt="%Y%m%d %I:%M:%S")
else:
    logging.basicConfig(
        format="%(asctime)s:%(levelname)s:%(message)s", level=logging.WARNING, datefmt="%Y%m%d %I:%M:%S"
    )


cacheNew = sqlite.sqlite()
cacheNew.setCacheLocation(args["cacheNew"])
cacheNew.initialize()

cacheOld = sqlite.sqlite()
cacheOld.setCacheLocation(args["cacheOld"])
cacheOld.initialize()

cmpr = CompleteComparer()

cmpr.setNewCache(cacheNew)
cmpr.setOldCache(cacheOld)
cmpr.initialize()


stats = {
    "count": {"getMovedFiles": 0, "getDeletedFiles": 0, "getChangedFiles": 0, "getNewFiles": 0},
    "sizes": {"getMovedFiles": 0, "getDeletedFiles": 0, "getChangedFiles": 0, "getNewFiles": 0},
}


for paths in cmpr.getMovedFiles():
    logging.debug("    ren %s --> %s" % (paths[1], paths[0]))
    stats["sizes"]["getMovedFiles"] += paths[2]
Пример #2
0
                        level=logging.DEBUG,
                        datefmt='%Y%m%d %I:%M:%S')
else:
    logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s',
                        level=logging.WARNING,
                        datefmt='%Y%m%d %I:%M:%S')

cacheNew = sqlite.sqlite()
cacheNew.setCacheLocation(args['cacheNew'])
cacheNew.initialize()

cacheOld = sqlite.sqlite()
cacheOld.setCacheLocation(args['cacheOld'])
cacheOld.initialize()

cmpr = CompleteComparer()

cmpr.setNewCache(cacheNew)
cmpr.setOldCache(cacheOld)
cmpr.initialize()

stats = {
    'count': {
        'getMovedFiles': 0,
        'getDeletedFiles': 0,
        'getChangedFiles': 0,
        'getNewFiles': 0,
    },
    'sizes': {
        'getMovedFiles': 0,
        'getDeletedFiles': 0,
Пример #3
0
tracker = LogTracker(args["verbose"])
# tracker = LogTracker(0)


cacheNew = sqlite.sqlite()
cacheNew.setCacheLocation(args["cacheNew"])
cacheNew.initialize()

cacheNew.log("[%s] start" % (os.path.basename(__file__)))

cacheOld = sqlite.sqlite()
cacheOld.setCacheLocation(args["cacheOld"])
cacheOld.initialize()

doApply = True
cmpr = CompleteComparer()

cmpr.setNewCache(cacheNew)
cmpr.setOldCache(cacheOld)
cmpr.initialize()

wrt = Writer(args["destination"], args["source"])
wrt.initialize()

wrt.registerProgressCallback(callbackWriter)

wrtbackup = BackupWriter(args["destinationBackup"], args["destination"], args["source"], time.strftime("%Y%m%d%H%M%S"))
wrtbackup.initialize()

cacheNew.log("[%s] initialized" % (os.path.basename(__file__)))
Пример #4
0
tracker = LogTracker(args['verbose'])
#tracker = LogTracker(0)

cacheNew = sqlite.sqlite()
cacheNew.setCacheLocation(args['cacheNew'])
cacheNew.initialize()

cacheNew.log("[%s] start" % (os.path.basename(__file__)))

cacheOld = sqlite.sqlite()
cacheOld.setCacheLocation(args['cacheOld'])
cacheOld.initialize()

doApply = True
cmpr = CompleteComparer()

cmpr.setNewCache(cacheNew)
cmpr.setOldCache(cacheOld)
cmpr.initialize()

wrt = Writer(args['destination'], args['source'])
wrt.initialize()

wrt.registerProgressCallback(callbackWriter)

wrtbackup = BackupWriter(args['destinationBackup'], args['destination'],
                         args['source'], time.strftime("%Y%m%d%H%M%S"))
wrtbackup.initialize()

cacheNew.log("[%s] initialized" % (os.path.basename(__file__)))