Ejemplo n.º 1
0
def backup_database(full=False):
    if not os.path.exists(APP_BACKUP_DIR):
        os.makedirs(APP_BACKUP_DIR)

    filename = os.path.join(APP_BACKUP_DIR, 'stoq.dump')
    if not db_settings.dump_database(filename, format='plain'):
        raise TaskException("Failed to dump the database")

    # FIXME: Change this to a global import when windows support it
    backup.backup(APP_BACKUP_DIR, full=full)
    logger.info("Database backup finished sucessfully")
Ejemplo n.º 2
0
def backup_database(full=False):
    if not os.path.exists(APP_BACKUP_DIR):
        os.makedirs(APP_BACKUP_DIR)

    filename = os.path.join(APP_BACKUP_DIR, 'stoq.dump')
    if not db_settings.dump_database(filename, format='plain'):
        raise TaskException("Failed to dump the database")

    # FIXME: Change this to a global import when windows support it
    backup.backup(APP_BACKUP_DIR, full=full)
    logger.info("Database backup finished sucessfully")