|
|
|
@ -1,13 +1,14 @@ |
|
|
|
#!/usr/bin/python |
|
|
|
from backup import hashify |
|
|
|
import argparse |
|
|
|
import datetime |
|
|
|
import time |
|
|
|
import shutil |
|
|
|
import os |
|
|
|
import shutil |
|
|
|
import sqlite3 |
|
|
|
import time |
|
|
|
import time |
|
|
|
|
|
|
|
def create_temp(): |
|
|
|
name= 'fsb{}'.format(datetime.datetime.today()) |
|
|
|
name= 'fsb{}'.format(hex(time.time_ns())[2:]) |
|
|
|
os.mkdir(name) |
|
|
|
return name |
|
|
|
def lookup(cur,imohash,realhash=None): |
|
|
|
@ -30,7 +31,8 @@ def restore(database,source,destination): |
|
|
|
parent = os.path.dirname(qpath) |
|
|
|
if not os.path.exists(parent): |
|
|
|
os.makedirs(parent) |
|
|
|
shutil.move(ppath,qpath) |
|
|
|
print(ppath,qpath,sep = '->') |
|
|
|
os.rename(ppath,qpath) |
|
|
|
os.rename(temp,destination) |
|
|
|
if __name__ == "__main__": |
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
|