Implemented whitelist

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-25 22:33:28 +01:00
parent b06317ad48
commit 397e242e5b

View File

@ -137,6 +137,22 @@ def main():
databases = pandas.read_csv(os.path.join(dirname, "databases.csv"), sep=";") databases = pandas.read_csv(os.path.join(dirname, "databases.csv"), sep=";")
volume_names = execute_shell_command("docker volume ls --format '{{.Name}}'") volume_names = execute_shell_command("docker volume ls --format '{{.Name}}'")
# This whitelist is configurated for https://github.com/kevinveenbirkenbach/backup-docker-to-local
stop_and_restart_not_needed = [
'baserow',
'element',
'gitea',
'listmonk',
'mastodon',
'matomo',
'memcached',
'nextcloud',
'openproject',
'pixelfed',
'redis',
'wordpress'
]
for volume_name in volume_names: for volume_name in volume_names:
print(f'Start backup routine for volume: {volume_name}') print(f'Start backup routine for volume: {volume_name}')
containers = execute_shell_command(f"docker ps --filter volume=\"{volume_name}\" --format '{{.Names}}'") containers = execute_shell_command(f"docker ps --filter volume=\"{volume_name}\" --format '{{.Names}}'")
@ -144,7 +160,7 @@ def main():
print('Skipped due to no running containers using this volume.') print('Skipped due to no running containers using this volume.')
continue continue
backup_routine_for_volume(volume_name, containers, databases, version_dir, []) backup_routine_for_volume(volume_name, containers, databases, version_dir, stop_and_restart_not_needed)
print('Finished volume backups.') print('Finished volume backups.')