Giter Club home page Giter Club logo

docker-backup-volume's Introduction

Backing up your docker volumes

How to backup your volume

backup-volume.sh will create a new running docker container and mount the volume to the container. A docker cp will be run and the contents of the volume will be saved into a location determined by:

$prefix/$volume/<timestamp>_$volume.tar.gz

An example to run the command is the following:

backup-volume.sh -v <volume_name> -p <prefix>

Restoring your docker volume

Volumes can be restored using create-volume-from-backup.sh by invoking it in the following manner:

create-volume-from-backup.sh -v <volume_name> -p <prefix>

Optionally if you wish to create a volume with a different name from the backup the script can be invoked in the following manner:

create-volume-from-backup.sh -v <volume_name> -p <prefix> -n <new_volume_name>

Execution Example

The animation below illustrates how the docker volume owncloud-docker_files is saved to /tmp/backups/owncloud-docker_files. The volume is saved as a zipped tar file with the date and time it was saved.

The following animation shows how the docker volume is restored from /tmp/backups by specifying the snapshot file to restore fom. Note: If you wish to restore the docker volume with a different name than the backup, this can be done by adding a -n flag to the command and specifying the new volume name.

Created by www.spherex.dev

We hope this code is useful for you.

docker-backup-volume's People

Contributors

spherex-dev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.