mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-21 16:01:03 +01:00
Optimized
This commit is contained in:
parent
e063a05f91
commit
ea3fb0158b
@ -9,10 +9,11 @@ do
|
||||
echo "stop container: $docker_container_id" && docker stop "$docker_container_id"
|
||||
for rsync_source_path in "${backup_folders[@]}";
|
||||
do
|
||||
rsync_destination_path="$docker_backup_folder_path""last/""$docker_container_id/$rsync_source_path";
|
||||
rsync_destination_path="$docker_backup_folder_path""last/""$docker_container_id$rsync_source_path";
|
||||
#backup_dir_path="$backup_dir_base_path$rsync_source_path";
|
||||
echo "trying to backup $rsync_source_path..."
|
||||
docker run --rm --volumes-from "$docker_container_id" -v "$host_backup_folder_path:$docker_backup_folder_path" "kevinveenbirkenbach/alpine-rsync" bash -c "test -e $rsync_source_path && rsync -a --delete $rsync_source_path $rsync_destination_path"
|
||||
mkdir -p "$HOME$rsync_destination_path"
|
||||
docker run --rm --volumes-from "$docker_container_id" -v "$host_backup_folder_path:$docker_backup_folder_path" "kevinveenbirkenbach/alpine-rsync" rsync -a --delete $rsync_source_path $rsync_destination_path
|
||||
done
|
||||
echo "start container: $docker_container_id" && docker start "$docker_container_id"
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user