updating some scripts - fixes, mostly. conf_minify works WAY better now.

This commit is contained in:
brent s
2018-10-18 14:13:34 -04:00
parent d84a98520a
commit 6f450ab68f
8 changed files with 140 additions and 41 deletions

View File

@@ -45,6 +45,12 @@ class Backup(object):
if self.args['oper'] == 'backup':
for d in (self.args['mysqldir'], self.args['stagedir']):
os.makedirs(d, exist_ok = True, mode = 0o700)
if self.args['oper'] == 'restore':
self.args['target_dir'] = os.path.abspath(os.path.expanduser(
self.args['target_dir']))
os.makedirs(os.path.dirname(self.args['oper']),
exist_ok = True,
mode = 0o700)
### LOGGING ###
# Thanks to:
# https://web.archive.org/web/20170726052946/http://www.lexev.org/en/2013/python-logging-every-day/
@@ -255,7 +261,8 @@ class Backup(object):
self.cfg['config']['host'],
r,
self.args['archive']))
# TODO: support specific path of extract?
_cmd.append(os.path.abspath(self.args['target_dir']))
# TODO: support specific path inside archive?
# if so, append path(s) here.
_env['BORG_PASSPHRASE'] = self.cfg['repos'][r]['password']
self.logger.debug('VARS: {0}'.format(vars()))

View File

@@ -159,6 +159,8 @@ class MtreeXML(object):
return(out)
def _unset_parse(unsetline):
out = {}
if unsetline[1] == 'all':
return(copy.deepcopy(self._tplitem))
for i in unsetline:
out[i] = self._tplitem[i]
return(out)