Example #1
0
def backup_dump(db):   
    from toughradius.tools.backup import dumpdb
    from toughradius.tools.config import find_config
    backup_path = app.config.get('database.backup_path','/var/toughradius/data')  
    backup_file = "toughradius_db_%s.json.gz"%utils.gen_backep_id()
    try:
        dumpdb(find_config(),os.path.join(backup_path,backup_file))
        return dict(code=0,msg="backup done!")
    except Exception as err:
        return dict(code=1,msg="backup fail! %s"%(err))
Example #2
0
def backup_dump(db):
    from toughradius.tools.backup import dumpdb
    from toughradius.tools.config import find_config
    backup_path = app.config.get('database.backup_path',
                                 '/var/toughradius/data')
    backup_file = "toughradius_db_%s.json.gz" % utils.gen_backep_id()
    try:
        dumpdb(find_config(), os.path.join(backup_path, backup_file))
        return dict(code=0, msg="backup done!")
    except Exception as err:
        return dict(code=1, msg="backup fail! %s" % (err))
Example #3
0
def backup_restore(db):   
    from toughradius.tools.backup import dumpdb,restoredb
    from toughradius.tools.config import find_config
    backup_path = app.config.get('database.backup_path','/var/toughradius/data')  
    backup_file = "toughradius_db_%s.before_restore.json.gz"%utils.gen_backep_id()
    rebakfs = request.params.get("bakfs")
    try:
        dumpdb(find_config(),os.path.join(backup_path,backup_file))
        restoredb(find_config(),os.path.join(backup_path,rebakfs))
        return dict(code=0,msg="restore done!")
    except Exception as err:
        return dict(code=1,msg="restore fail! %s"%(err)) 
Example #4
0
def backup_restore(db):
    from toughradius.tools.backup import dumpdb, restoredb
    from toughradius.tools.config import find_config
    backup_path = app.config.get('database.backup_path',
                                 '/var/toughradius/data')
    backup_file = "toughradius_db_%s.before_restore.json.gz" % utils.gen_backep_id(
    )
    rebakfs = request.params.get("bakfs")
    try:
        dumpdb(find_config(), os.path.join(backup_path, backup_file))
        restoredb(find_config(), os.path.join(backup_path, rebakfs))
        return dict(code=0, msg="restore done!")
    except Exception as err:
        return dict(code=1, msg="restore fail! %s" % (err))
Example #5
0
def run_dumpdb(config, dumpfs):
    from toughradius.tools import backup

    backup.dumpdb(config, dumpfs)
Example #6
0
def run_dumpdb(config, dumpfs):
    from toughradius.tools import backup
    backup.dumpdb(config, dumpfs)