2017-03-26 10:27:07 +00:00
|
|
|
# volume-backup
|
|
|
|
|
|
|
|
An utility to backup and restore [docker volumes](https://docs.docker.com/engine/reference/commandline/volume/).
|
|
|
|
|
2017-03-26 10:30:18 +00:00
|
|
|
**Note**: Make sure no container is using the volume before backup or restore, otherwise your data might be damaged.
|
2017-03-26 10:27:07 +00:00
|
|
|
|
|
|
|
## Backup
|
|
|
|
|
|
|
|
Syntax:
|
|
|
|
|
2017-04-09 09:12:10 +00:00
|
|
|
docker run -v [volume-name]:/volume -v [output-dir]:/backup --rm loomchild/volume-backup backup [archive-name]
|
2017-03-26 10:27:07 +00:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2017-04-09 09:12:10 +00:00
|
|
|
docker run -v some_volume:/volume -v /tmp:/backup --rm loomchild/volume-backup backup archive1
|
2017-03-26 10:27:07 +00:00
|
|
|
|
|
|
|
will archive volume named `some_volume` to `/tmp/archive.tar.bz2` archive file.
|
|
|
|
|
|
|
|
## Restore
|
|
|
|
|
2017-03-26 10:30:18 +00:00
|
|
|
**Note**: This operation will delete all contents of the volume
|
|
|
|
|
2017-03-26 10:27:07 +00:00
|
|
|
Syntax:
|
|
|
|
|
2017-04-09 09:12:10 +00:00
|
|
|
docker run -v [volume-name]:/volume -v [output-dir]:/backup --rm loomchild/volume-backup restore [archive-name]
|
2017-03-26 10:27:07 +00:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2017-04-09 09:12:10 +00:00
|
|
|
docker run -v some_volume:/volume -v /tmp:/backup --rm loomchild/volume-backup restore archive1
|
2017-03-26 10:27:07 +00:00
|
|
|
|
|
|
|
will clean and restore volume named `some_volume` from `/tmp/archive.tar.bz2` archive file.
|