mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-22 08:21:04 +01:00
Optimized constructor
This commit is contained in:
parent
fc09e21519
commit
0859dbbedd
@ -17,12 +17,14 @@ do
|
|||||||
then
|
then
|
||||||
echo "backup: $source_path"
|
echo "backup: $source_path"
|
||||||
destination_path="$latest_destination_path";
|
destination_path="$latest_destination_path";
|
||||||
mkdir -p "$native_backups_mount_prefix$backup_dir_path";
|
|
||||||
else
|
else
|
||||||
echo "first backup: $source_path"
|
echo "first backup: $source_path"
|
||||||
destination_path="$first_destination_path";
|
destination_path="$first_destination_path";
|
||||||
|
mkdir -vp "$native_backups_mount_prefix$first_destination_path";
|
||||||
|
mkdir -vp "$native_backups_mount_prefix$latest_destination_path";
|
||||||
|
mkdir -vp "$native_backups_mount_prefix$backup_dir_path";
|
||||||
fi
|
fi
|
||||||
mkdir -p "$native_backups_mount_prefix$destination_path";
|
|
||||||
docker run --rm --volumes-from "$docker_container_name" -v "$native_backups_mount:$docker_backups_mount" "kevinveenbirkenbach/alpine-rsync" sh -c "
|
docker run --rm --volumes-from "$docker_container_name" -v "$native_backups_mount:$docker_backups_mount" "kevinveenbirkenbach/alpine-rsync" sh -c "
|
||||||
test -d $source_path &&
|
test -d $source_path &&
|
||||||
mkdir -p \"$destination_path\" &&
|
mkdir -p \"$destination_path\" &&
|
||||||
|
Loading…
Reference in New Issue
Block a user