31 lines
1.3 KiB
Bash
Executable file
31 lines
1.3 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
. ./tests/common.sh
|
|
|
|
# archive whole directory
|
|
workdir="$(create_directories 127)"
|
|
filename="$(basename "$(find "$workdir/source" -type f)")"
|
|
docker_volume="$(create_docker_volume "$workdir" "$filename")"
|
|
./tarback.sh -p docker create "$docker_volume" "$workdir/dest/source.tar.xz"
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
|
docker_volume="$(create_docker_volume)"
|
|
./tarback.sh -p docker restore "$workdir/dest/source.tar.xz" "$docker_volume"
|
|
extract_docker_volume "$docker_volume" "$workdir" "$filename"
|
|
diff "$workdir/source" "$workdir/restore"
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
|
rm -rf "$workdir"
|
|
|
|
workdir="$(create_directories 127)"
|
|
filename="$(basename "$(find "$workdir/source" -type f)")"
|
|
docker_volume="$(create_docker_volume "$workdir" "$filename")"
|
|
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -p docker create "$docker_volume" "$workdir/dest/source.tar.xz"
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
|
docker_volume="$(create_docker_volume)"
|
|
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -p docker restore "$workdir/dest/source.tar.xz" "$docker_volume"
|
|
extract_docker_volume "$docker_volume" "$workdir" "$filename"
|
|
diff "$workdir/source" "$workdir/restore"
|
|
docker volume rm "$docker_volume" 2>/dev/null 1>&2
|
|
rm -rf "$workdir"
|
|
|