How to take backup of docker volumes?
Asked Answered
S

1

6

I'm using named volumes to persist data on Host machine in the cloud.

I want to take backup of these volumes present in the docker environment so that I can reuse them on critical incidents.

Almost decided to write a python script to compress the specified directory on the host machine and push it to the AWS S3.

But I would like to know if there is any other approaches to this problem?

Sternutatory answered 10/2, 2021 at 15:26 Comment(0)
H
6

docker-volume-backup may be helpful. It allows you to back up your Docker volumes to an external location or to a S3 storage.

Why use a Docker container to back up a Docker volume instead of writing your own Python script? Ideally you don't want to make backups while the volume is being used, so having a container on your docker-compose able to properly stop your container before taking backups can effectively copy data without affecting the application performance or backup integrity.

There's also this alternative: volume-backup

Hussar answered 10/2, 2021 at 23:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.