source: n4d-backup-manager/trunk/fuentes/n4d-backup-manager.install/usr/share/n4d/python-plugins/PmbManager.py @ 2194

Last change on this file since 2194 was 2194, checked in by Juanma, 3 years ago

Initial Release

File size: 796 bytes
Line 
1import imp
2import os
3import subprocess
4backupmanager=imp.load_source("BackupManager","/usr/share/n4d/python-plugins/support/BackupManager.py")
5
6class PmbManager:
7       
8        def __init__(self):
9                self.pmb=backupmanager.BackupManager(app='pmb')
10                pmbFiles={} 
11                pmbDbFiles={'pmb':['/etc/pmb/debian-db.php']} 
12
13                self.pmb.set_app_files(pmbFiles)
14                self.pmb.set_app_dbFiles(pmbDbFiles) 
15
16        def restore(self,file_path=None):
17                self.pmb.set_backup_name("PmbManager")
18                retVal=self.pmb.restore(file_path)
19                return retVal
20
21
22        def backup(self,dir='/backup'):
23                self.pmb.set_backup_name(get_backup_name("PmbManager"))
24                retVal=self.pmb.backup(dir)
25                self.last_operations()
26                return retVal
27
28        def last_operations(self):
29                #Regenerate cnames
30                cmd="lliurex-pmb --hosts"
31                return (os.system(cmd))
32               
33                               
Note: See TracBrowser for help on using the repository browser.