mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-22 00:11:03 +01:00
Implemented log
This commit is contained in:
parent
3eef4cf70a
commit
cafd49f216
@ -11,6 +11,7 @@ do
|
|||||||
do
|
do
|
||||||
application_path="$docker_backups_mount$(cat /etc/machine-id)/docker/$docker_container_name/";
|
application_path="$docker_backups_mount$(cat /etc/machine-id)/docker/$docker_container_name/";
|
||||||
destination_path="$application_path""latest""$source_path";
|
destination_path="$application_path""latest""$source_path";
|
||||||
|
log_path="$application_path""log.txt";
|
||||||
backup_dir_path="$application_path""diffs/$backup_time$source_path";
|
backup_dir_path="$application_path""diffs/$backup_time$source_path";
|
||||||
if [ -d "$native_backups_mount_prefix$destination_path" ]
|
if [ -d "$native_backups_mount_prefix$destination_path" ]
|
||||||
then
|
then
|
||||||
@ -21,7 +22,7 @@ do
|
|||||||
mkdir -vp "$native_backups_mount_prefix$backup_dir_path";
|
mkdir -vp "$native_backups_mount_prefix$backup_dir_path";
|
||||||
fi
|
fi
|
||||||
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 "
|
||||||
rsync -ab --delete --delete-excluded --backup-dir=\"$(dirname "$backup_dir_path")\" $source_path $destination_path";
|
rsync -abvv --delete --delete-excluded --log-file=$log_path --backup-dir=$(dirname "$backup_dir_path") $source_path $destination_path";
|
||||||
done
|
done
|
||||||
echo "start container: $docker_container_name" && docker start "$docker_container_name"
|
echo "start container: $docker_container_name" && docker start "$docker_container_name"
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user