File size: 676 Bytes
0779f68 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
#!/bin/bash
path_A=./
path_B=./
# # Packing phase
# for dir in images_part{00..34}; do
# (
# echo "Starting to pack $dir at $(date)"
# # Pack the directory from path_A and save the tar file to path_B
# tar -cvf ${path_B}/${dir}.tar -C ${path_A} ${dir}
# echo "$dir packed successfully at $(date)"
# ) &
# done
# wait
# Unpacking phase
for dir in images_part{00..00}.tar; do
(
cd ${path_B}
# Extract the base name from the tar file
base_name=$(basename "$dir" .tar)
echo "Starting to unpack $dir at $(date)"
# Extract the contents of the tarball
tar -xvf ${dir}
echo "$dir unpacked successfully at $(date)"
) &
done
wait
|