mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-24 01:01:03 +01:00
Removed redundant code
This commit is contained in:
parent
9a5b544e0b
commit
0322eee107
@ -189,16 +189,11 @@ def backup_with_containers_paused(volume_name, volume_dir, versions_dir, contain
|
|||||||
start_containers(containers)
|
start_containers(containers)
|
||||||
|
|
||||||
def backup_mariadb_or_postgres(container, volume_dir):
|
def backup_mariadb_or_postgres(container, volume_dir):
|
||||||
# Execute MariaDB procedure
|
'''Performs database image specific backup procedures'''
|
||||||
if has_image(container, 'mariadb'):
|
for image in ['mariadb','postgres']:
|
||||||
backup_database(container, volume_dir, 'mariadb')
|
if has_image(container, image):
|
||||||
|
backup_database(container, volume_dir, image)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Execute Postgres procedure
|
|
||||||
if has_image(container, 'postgres'):
|
|
||||||
backup_database(container, volume_dir, 'postgres')
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@ -228,9 +223,11 @@ def default_backup_routine_for_volume(volume_name, containers, version_dir, vers
|
|||||||
def backup_everything(volume_name, containers, version_dir, versions_dir):
|
def backup_everything(volume_name, containers, version_dir, versions_dir):
|
||||||
"""Perform file backup routine for a given volume."""
|
"""Perform file backup routine for a given volume."""
|
||||||
volume_dir=create_volume_directory(version_dir, volume_name)
|
volume_dir=create_volume_directory(version_dir, volume_name)
|
||||||
|
|
||||||
# Execute sql dumps
|
# Execute sql dumps
|
||||||
for container in containers:
|
for container in containers:
|
||||||
backup_mariadb_or_postgres(container, volume_dir)
|
backup_mariadb_or_postgres(container, volume_dir)
|
||||||
|
|
||||||
# Execute file backups
|
# Execute file backups
|
||||||
backup_volume(volume_name, volume_dir, versions_dir)
|
backup_volume(volume_name, volume_dir, versions_dir)
|
||||||
backup_with_containers_paused(volume_name, volume_dir, versions_dir, containers)
|
backup_with_containers_paused(volume_name, volume_dir, versions_dir, containers)
|
||||||
|
Loading…
Reference in New Issue
Block a user