2023-06-07 21:53:14 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
. ./tests/common.sh
|
|
|
|
|
|
|
|
export TARBACK_REMOTE='ssh localhost'
|
|
|
|
|
|
|
|
# archive whole directory
|
2023-06-07 23:54:52 +02:00
|
|
|
workdir="$(create_directories 127)"
|
2023-06-07 21:53:14 +02:00
|
|
|
filename="$(basename "$(find "$workdir/source" -type f)")"
|
2023-06-07 23:54:52 +02:00
|
|
|
docker_volume="$(create_docker_volume "$workdir" "$filename")"
|
2023-06-08 17:49:26 +02:00
|
|
|
./tarback.sh -P ssh,docker create "$docker_volume" "$workdir/dest/source.tar.xz"
|
2023-06-07 23:54:52 +02:00
|
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
|
|
|
docker_volume="$(create_docker_volume)"
|
2023-06-08 17:49:26 +02:00
|
|
|
./tarback.sh -P ssh,docker restore "$workdir/dest/source.tar.xz" "$docker_volume"
|
2023-06-07 23:54:52 +02:00
|
|
|
extract_docker_volume "$docker_volume" "$workdir" "$filename"
|
2023-06-07 21:53:14 +02:00
|
|
|
diff "$workdir/source" "$workdir/restore"
|
2023-06-07 23:54:52 +02:00
|
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
2023-06-07 21:53:14 +02:00
|
|
|
rm -rf "$workdir"
|
|
|
|
|
2023-06-07 23:54:52 +02:00
|
|
|
workdir="$(create_directories 127)"
|
2023-06-07 21:53:14 +02:00
|
|
|
filename="$(basename "$(find "$workdir/source" -type f)")"
|
2023-06-07 23:54:52 +02:00
|
|
|
docker_volume="$(create_docker_volume "$workdir" "$filename")"
|
2023-06-08 17:49:26 +02:00
|
|
|
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -P ssh,docker create "$docker_volume" "$workdir/dest/source.tar.xz"
|
2023-06-07 23:54:52 +02:00
|
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
|
|
|
docker_volume="$(create_docker_volume)"
|
2023-06-08 17:49:26 +02:00
|
|
|
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -P ssh,docker restore "$workdir/dest/source.tar.xz" "$docker_volume"
|
2023-06-07 23:54:52 +02:00
|
|
|
extract_docker_volume "$docker_volume" "$workdir" "$filename"
|
2023-06-07 21:53:14 +02:00
|
|
|
diff "$workdir/source" "$workdir/restore"
|
2023-06-07 23:54:52 +02:00
|
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
2023-06-07 21:53:14 +02:00
|
|
|
rm -rf "$workdir"
|
2023-06-07 23:54:52 +02:00
|
|
|
|