Skip to content

gorschu/docker-volume-backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

volume-backup

An utility to backup and restore docker volumes.

Note: Make sure no container is using the volume before backup or restore, otherwise your data might be damaged.

Backup

Syntax:

docker run -v [volume-name]:/volume -v [output-dir]:/backup --rm loomchild/volume-backup backup [archive-name]

For example:

docker run -v some_volume:/volume -v /tmp:/backup --rm loomchild/volume-backup backup archive1

will archive volume named some_volume to /tmp/archive.tar.bz2 archive file.

Restore

  • Note: This operation will delete all contents of the volume
  • Note: The volume to be restored needs to be created first (docker volume create <volume>)

Syntax:

docker run -v [volume-name]:/volume -v [output-dir]:/backup --rm loomchild/volume-backup restore [archive-name]

For example:

docker run -v some_volume:/volume -v /tmp:/backup --rm loomchild/volume-backup restore archive1

will clean and restore volume named some_volume from /tmp/archive.tar.bz2 archive file.

Wrapper scripts

bin/backup.sh and bin/restore.sh are little wrapper scripts that simplify invocation and also check for existing/in-use volumes and act accordingly.

About

docker volume backup & restore utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%