Comments (5)
I was able to create a shell script that uses the vackup script. This way I can backup all volumes on the system. Look:
Thanks for your script. I managed to create a systemd service with your script to automate the backup once every day. If anyone is interested : Vackup all
from docker-vackup.
Hey there. I don't think this will need many (or any) updates because 1. it's just bash and 2. it's just basic docker commands that have worked for 10 years without edits.
In real storage, you usually need more than a file copy for backups. Databases all have their own backup tools to ensure you get proper backups, and backup systems usually are on a schedule, do retries, etc. This script isn't meant to replace a full backup system, but just an easy way to copy volumes from one system to another.
from docker-vackup.
I was able to create a shell script that uses the vackup script. This way I can backup all volumes on the system. Look:
#!/bin/bash
# Note: Before running this script, install the Vackup command,
# installation information can be found at the link below:
# https://github.com/BretFisher/docker-vackup
clear
## Variables
volumes=$(docker volume ls -q)
dts=$(date +%d%m%y_%H%M%S)
pathroot=/backup
pathbkp=$pathroot/$dts
## Remove subfolders from the backup directory that are more than 7 days old
find $pathroot -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -r {} \;
## Create and enter the backup directory
mkdir $pathbkp && cd $pathbkp
## Backing up volumes and creating backup logs
for volume in $volumes
do
/usr/local/bin/vackup export $volume $volume.tar.gz | tee log_$volume.txt
done
from docker-vackup.
@cerebrux I'm very happy to know that my script was useful to you.
from docker-vackup.
In case anybody is interested, I'm using this script to backup all my containers. The main differences are, that the script stops all running containers before copying the volumes and restarting stopped containers, and also that it uses the docker-autocompose script as well to generate a compose file with all containers.
from docker-vackup.
Related Issues (9)
- add quick install commands to the README HOT 2
- Why is it deprecated? HOT 3
- [Question] Should the stack be running? HOT 1
- Support automated restore if the image is run
- Option for staying running in compose with healthchecks for depends_on support
- Importing Not working on Centos 7 HOT 2
- Question to use the backup script? HOT 4
- Docker backup all volumes
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 docker-vackup.