elydium / docker-azure-backup

a docker service to make backup of files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker-backup-azure

This container help you to backup importants files which are generated into a specific folder to Microsoft Azure Storage.

E.G. : I use this redmine docker with automatic backup. So with this container, each time a backup is created, it's uploaded to azure blob storage.

Environment variables

  • $CONTAINER - Container name in azure
  • $AZURE_STORAGE_ACCOUNT - Name of Azure Storare Account
  • $AZURE_STORAGE_ACCESS_KEY - Acess Key for Storage Account

Example of running

docker run -d --name docker-azure-backup \
-e "AZURE_STORAGE_ACCOUNT=azure-storage" \
-e "AZURE_STORAGE_ACCESS_KEY=ashdgashdgasdsa--dadcdsfsd/sdfd--" \
-e "CONTAINER=logs-backup" \
-v /var/log:/var/files:ro \
nagarian47/docker-azure-backup

Building image

If you want to build this docker by yourself, it's whith this command :

docker build -t nagarian47/docker-azure-backup .

Backup

List available backup on azure

When you want to restore a file from azure, you must want to know what's have been uploaded yet. So you can obtain this information with this command-line :

docker exec -it docker-azure-backup azure-backup backup list

And you can filter this list with specify a <schema> :

docker exec -it docker-azure-backup azure-backup backup list backup-*

Restore backup from azure

To restore a file from azure, you have to do :

docker exec -it docker-azure-backup azure-backup backup restore <file-name>

NB : In order to use this feature, you need to run this docker with no read-only folder

docker run -d --name docker-azure-backup \
-e "AZURE_STORAGE_ACCOUNT=azure-storage" \
-e "AZURE_STORAGE_ACCESS_KEY=your-personnal-key" \
-e "CONTAINER=logs-backup" \
-v /var/log:/var/files \
nagarian47/docker-azure-backup

Other Usage

Display commands help

If you don't know what you can do, display the help :

docker exec -it docker-azure-backup azure-backup help

Get event logs

You can obtain logs of uploaded files by tiping this command :

docker logs -f docker-azure-backup

Get a shell

If you have (want) to troubleshoot this container, you can have a shell by tiping :

docker exec -it docker-azure-backup bash

Usage

Get event logs

docker logs -f docker-azure-backup

About

a docker service to make backup of files

License:Apache License 2.0


Languages

Language:Shell 100.0%