bakthat icon indicating copy to clipboard operation
bakthat copied to clipboard

Allowing you to use config dict

Open Sets88 opened this issue 9 years ago • 0 comments

With current version you cant pass bakthat_conf configuration as it said in documentation, it is not handling, my changes will help to handle it

#! /usr/bin/python

import logging
import sh
logging.basicConfig(level=logging.INFO)

from bakthat.helper import BakHelper

bakthat_conf = {'access_key': 'aaaaaaaaaaaaa',
                'secret_key': 'bbbbbbbbbbbbbbbbbbbb',
                'glacier_vault': '',
                'plugins_dir': '/root',
                's3_bucket': 'backup',
                'region_name': 'us-east-1',
                'rotation': {'days': 7,
                            'first_week_day': 5,
                            'months': 6,
                            'weeks': 6}}



BACKUP_NAME = "my_backup"
BACKUP_PASSWORD = "password"

with BakHelper(BACKUP_NAME, password=BACKUP_PASSWORD, conf=bakthat_conf, tags=["postgresql"]) as bh:
    sh.pg_dump("testdb", _out="dump_testdb.sql")
    bh.backup()
    bh.rotate()

Sets88 avatar Jun 23 '15 18:06 Sets88