import imp import os import subprocess backupmanager=imp.load_source("BackupManager","/usr/share/n4d/python-plugins/support/BackupManager.py") class PmbManager: def __init__(self): self.pmb=backupmanager.BackupManager(app='pmb') pmbFiles={} pmbDbFiles={'pmb':['/etc/pmb/debian-db.php']} self.pmb.set_app_files(pmbFiles) self.pmb.set_app_dbFiles(pmbDbFiles) def restore(self,file_path=None): self.pmb.set_backup_name("PmbManager") retVal=self.pmb.restore(file_path) return retVal def backup(self,dir='/backup'): self.pmb.set_backup_name(get_backup_name("PmbManager")) retVal=self.pmb.backup(dir) self.last_operations() return retVal def last_operations(self): #Regenerate cnames cmd="lliurex-pmb --hosts" return (os.system(cmd))