feat: backup each container with its own path
This commit is contained in:
parent
dc42418bf7
commit
230445783a
1 changed files with 12 additions and 10 deletions
|
@ -205,17 +205,19 @@ def start_backup_process(config, containers):
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if has_volumes:
|
if has_volumes:
|
||||||
try:
|
logger.info('Backing up volumes')
|
||||||
logger.info('Backing up volumes')
|
for volume in [f.path for f in os.scandir('/volumes') if f.is_dir()]:
|
||||||
vol_result = restic.backup_files(config.repository, source='/volumes')
|
try:
|
||||||
logger.debug('Volume backup exit code: %s', vol_result)
|
logger.info('Backing up %s', volume)
|
||||||
if vol_result != 0:
|
vol_result = restic.backup_files(config.repository, source=volume)
|
||||||
logger.error('Volume backup exited with non-zero code: %s', vol_result)
|
logger.debug('Volume backup exit code: %s', vol_result)
|
||||||
|
if vol_result != 0:
|
||||||
|
logger.error('Volume backup exited with non-zero code: %s', vol_result)
|
||||||
|
errors = True
|
||||||
|
except Exception as ex:
|
||||||
|
logger.error('Exception raised during volume backup')
|
||||||
|
logger.exception(ex)
|
||||||
errors = True
|
errors = True
|
||||||
except Exception as ex:
|
|
||||||
logger.error('Exception raised during volume backup')
|
|
||||||
logger.exception(ex)
|
|
||||||
errors = True
|
|
||||||
|
|
||||||
# back up databases
|
# back up databases
|
||||||
logger.info('Backing up databases')
|
logger.info('Backing up databases')
|
||||||
|
|
Loading…
Add table
Reference in a new issue