Comments (4)
Hi. I see no particular problem - back-up each volume / mount separately. This should work regardless if volumes have names or are just mounted to host directories.
from volume-backup.
I did it like this:
TL;DR
Backup
docker inspect -f '{{range .Mounts}}docker run -v {{.Name}}:/volume --rm loomchild/volume-backup backup - > {{with split .Destination "/"}} {{join . "_"}}.tar.bz2 {{println}}{{end}}{{end}}' [containerid|name] | bash
Restore
docker inspect -f '{{range .Mounts}}cat {{with split .Destination "/"}}{{join . "_"}}.tar.bz2{{end}} | docker run -i -v {{.Name}}:/volume --rm loomchild/volume-backup restore - {{println}}{{end}}' [containerid|name] | bash
Explaination
I use the docker inspect
format option to build fully functional backup and restore commands and pipe them into bash
- that's it ;-)
@loomchild : maybe you want to add it to your README.md
from volume-backup.
Cool, thanks for sharing!
I will test it and do it later.
from volume-backup.
I did it like this:
TL;DR
Backup
docker inspect -f '{{range .Mounts}}docker run -v {{.Name}}:/volume --rm loomchild/volume-backup backup - > {{with split .Destination "/"}} {{join . "_"}}.tar.bz2 {{println}}{{end}}{{end}}' [containerid|name] | bashRestore
docker inspect -f '{{range .Mounts}}cat {{with split .Destination "/"}}{{join . "_"}}.tar.bz2{{end}} | docker run -i -v {{.Name}}:/volume --rm loomchild/volume-backup restore - {{println}}{{end}}' [containerid|name] | bashExplaination
I use the
docker inspect
format option to build fully functional backup and restore commands and pipe them intobash
- that's it ;-)@loomchild : maybe you want to add it to your README.md
Are you able to expand on this a little for the noobs (aka me)?
Right now I'm doing a bash script with all individual volumes, going into individual files (bit of a bugger to update each time).
Thanks!
from volume-backup.
Related Issues (20)
- Error while trying to restore the volume in other machine HOT 2
- add verbose mode to backup HOT 3
- Signals, such as Ctrl-C are not handled HOT 1
- restore from stdin expects bzip2 input HOT 3
- add option to include arbitrary tar options HOT 2
- include options for no-clobber HOT 4
- One-minute sleep should no longer be necessary HOT 2
- Cannot restore backuped volume: Archive file *.tar.bz2 does not exist HOT 3
- Fails to Run on Raspberry Pi 4 (aarch64) HOT 2
- Labels are not backuped / restored HOT 9
- Multi-arch builds for arm64 HOT 3
- Add image to ghcr.io repository HOT 1
- Stop containers before backup HOT 1
- Need 2x more space for backup HOT 13
- pbzip2 support? HOT 6
- Consider using parallel versions of algorithms by default HOT 2
- Automated monthly build (GitHub Actions) HOT 1
- Question: Why use `cat file |` instead of `< file`? HOT 3
- Consider an adaptive algorithm by default HOT 5
- Slow zstd compression HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volume-backup.