Skip to content

antoniocunh/docker-backup-volume

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backing up your docker volumes

Note

With this change when you create a backup with prefix it will be created inside the folder /Backups

Backup all volumes

backup-all.sh will verify all volumes and create a copy of each one insede the folder \Backups.

sudo ./backup-all.sh

Restore all volumes

restore-all.sh will verify all created backups and create a copy with the same name as the folder.

sudo ./restore-all.sh

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:

Backups/$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>

Created by www.spherex.dev

We hope this code is useful for you.

About

Tooling to backup docker volumes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%