本文整理汇总了Python中lib.db.DB.fs_deleted方法的典型用法代码示例。如果您正苦于以下问题:Python DB.fs_deleted方法的具体用法?Python DB.fs_deleted怎么用?Python DB.fs_deleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.db.DB
的用法示例。
在下文中一共展示了DB.fs_deleted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Run
# 需要导入模块: from lib.db import DB [as 别名]
# 或者: from lib.db.DB import fs_deleted [as 别名]
#.........这里部分代码省略.........
return
# We dont need to add it to the
try:
self.tarfile.add(name=path, recursive=False)
mod_time = self.get_file_time_str(path)
size = 0
type = 'D'
self.db.fs_saved(path, mod_time, size, type)
self.nfolders += 1
# Save the entry in the LOF
self.lof_record(folder, name, "D", mod_time, size)
except Exception as e:
log.warn("Exception backing up folder %s: %s" % (path, str(e)))
# If the exception is in the store - we crash and burn
# as we cannot save
if self.store_thread.error:
raise self.store_thread.error
# Otherwise log it and keep going...
msg = "Unable to backup %s: %s" % (path, str(e))
self.db.save_message(msg)
log.warn(msg)
def do_backup_deleted(self, folder, name):
path = os.path.join(folder, name)
if self.dry_run:
print("X - %s" % utils.escape(path))
sys.stdout.flush()
return
try:
log.debug("FILE/FOLDER DELETED:", name)
self.db.fs_deleted(path)
# We keep track of deletions
self.lof_record(folder, name, "X")
except Exception as e:
# If the exception is in the store - we crash and burn
# as we cannot save
if self.store_thread.error:
raise self.store_thread.error
# Otherwise log it and keep going...
msg = "Unable to backup %s: %s" % (path, str(e))
self.db.save_message(msg)
log.warn(msg)
def prepare_store(self):
# Test that the storage is available (this will connect and disconnect)
self.store.test()
# Connect to the store
self.store.connect()
try:
log.info("Preparing store")
# Ensure the store is properly marked and configured.
self.store.setup_store()
if self.backup.include_packages:
self.backup_packages()
# Backup the configuration
self.copy_file(const.ConfigFile, const.ConfigName)
finally: