mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-22 00:11:03 +01:00
Defined optional backup path
This commit is contained in:
parent
2ccca4bd95
commit
4e98fddcdb
@ -9,6 +9,12 @@ Execute:
|
|||||||
./docker-volume-backup.sh
|
./docker-volume-backup.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Optional a directory for the backup folder can be defined:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./docker-volume-backup.sh /tmp
|
||||||
|
```
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
Delete the volume.
|
Delete the volume.
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# @param $1 [optional] : The path in which the backups folder will be created.
|
||||||
backup_time="$(date '+%Y%m%d%H%M%S')"
|
backup_time="$(date '+%Y%m%d%H%M%S')"
|
||||||
docker_backups_mount="/Backups/"
|
docker_backups_mount="/Backups/"
|
||||||
native_backups_mount_prefix="$HOME"
|
native_backups_mount_prefix="$(test -z "$1" && echo "$HOME" || echo "$1")"
|
||||||
native_backups_mount="$native_backups_mount_prefix$docker_backups_mount"
|
native_backups_mount="$native_backups_mount_prefix$docker_backups_mount"
|
||||||
for docker_container_name in $(docker ps --format '{{.Names}}');
|
for docker_container_name in $(docker ps --format '{{.Names}}');
|
||||||
do
|
do
|
||||||
|
Loading…
Reference in New Issue
Block a user