def get_stamp(stampdir):
stampfile = os.path.join(stampdir,'stamp')
# read first line of stamp file
f = open(stampfile,mode='rt')
line = f.readline()
f.close()
# extract timestamp (first field of line) and compare to others
stamp = int( line.split().pop(0) )
if not stamp>0:
raise BackupError("Can't read `{}'".format(stampfile))
dt = datetime.utcfromtimestamp(stamp)
return dt
# find a list of backups for a particular machine
评论列表
文章目录