blob: 876ed31435fc36cbe6746c7311332ec9656d41f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# ABOUT
This is my collection of short and dirty bash script
to ease the execution of some common docker tasks.
# RESTORE NEW VOLUME FROM TAR ARCHIVE
./docker\_resotre\_vol.sh \[source-tar-archive\] \[new-target-volume\]
# BACKUP DOCKER VOLUMES
./docker\_backup\_vol.sh
Run without params for help. Supports --all-vols, --single-vol, --exclude-vol
# BACKUP DOCKER VOLUME OF A CONTAINER THAT IS NOT RUNNING
docker\_backup\_offline\_vol.sh
# BACKUP ALL MARIADB AND MYSQL DATABASES
./docker\_backup\_all\_sql.sh
Dumps all runinng containers where the image contains 'mariadb' or 'mysql'.
The root passwords are extracted via 'docker inspect'
# BACKUP SOME DATA ABOUT RUNNING CONTAINERS
./docker\_backup\_crazy.sh
The execution of this simple script will hopefully create a backup
of the following entities for all currently running docker containers:
- environment variables -> to a txt file
- all mounted file binds -> to a gzipped tar file
- all mounted directory binds -> to a gzipped tar file
- all mounted data volumes -> to a gzipped tar file
The backups will be placed in the current directory and prefixed
with a timestamp and container name.
# AUTO BACKUP ALL DOCKER-COMPOSE CONTAINERS IN A GIVEN TREE
docker\_compose\_backup.sh
# CAUTION
However this was never tested, the scripts will most likely fail
pathetically if variables containing spaces are encountered !!!
# COPYRIGHT
by the Software Fools Docker Division, 2017-2018 A.D.
|